Is there a way to prevent a creation of document in couchbase lite having the same doc id

If i create a document in couchbase lite with id “doc_1”

How do i prevent the user to create a new document with the same document id .

The flow should be like if the user is trying to create a document with the allready existing document id’s in the couchbase lite database he must not do it and there must not be any exceptions . i know that the couchbase lite generates a exception if the user tries to create documents having a duplicate id .

But is there anyother way to prevent the user from doing this

P.S: I don’t want the arbitrary document id to be created , i will always have the document id following the convention doc_number

Use the getExistingDocument(String id) to check if a doc with that id already exists in the database.

James