How can I make sure that data is persisted to disk?

Hello, while developing my project I encountered some problems. Firstly, how can I make sure that after making sub-document mutations the data is persisted to disk? For example, when I want to insert/upsert/replace the whole document I just do:
bucket.insert('key', 'value', { persist_to: 1 }, err => { // callback });
but in the documentation I cannot find where should I put persist options in mutation queries. The next question is: how about n1ql queries? Are they able to callback only when the data is persisted to disk?

Hey @wascript3r,

There is not currently a way to specify durability requirements with a sub-document mutation. I believe this is due to the fact that the underlying system for sub-document operations does not yet support the mutation tokens we rely on for confirming durability. I have however opened an issue to track this:

On the topic of durability requirements for N1QL, this is probably better asked in our N1QL forum, but I will try and get an answer for you on this topic as soon as possible.

Cheers, Brett

Thank you mate! I also think that it will be a great feature of couchbase! :slight_smile: