How to check document exists or not?

Simon from our SDK team replied to a similar question with this:

How to check whether a document exists or not?

Basically, on the @Erutan409 is correct: if all you want to know is if the document exists, then you need to get it and handle the response accordingly. If you want to make sure you don’t overwrite an existing document with that key, then you can use ADD or REPLACE to only overwrite an existing document.

On the Couchbase Server side, at least, the operation is lightweight.

1 Like