W3cubDocs

/RethinkDB Java

ReQL command: sync

Command syntax

table.sync() → object

Description

Ensure that writes on a given table are written to permanent storage. Queries that specify soft durability do not wait for writes to be committed to disk; a call to sync on a table will not return until all previous writes to the table are completed, guaranteeing the data’s persistence.

If successful, the operation returns an object: {"synced":1}.

Example: After having updated multiple heroes with soft durability, we now want to wait until these changes are persisted.

r.table("marvel").sync().run(conn);

Related commands

Get more help

Couldn't find what you were looking for?

© RethinkDB contributors
Licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
https://rethinkdb.com/api/java/sync/