replace
Inserts the JSON document read from source as insert does, and deletes the documents of docIds in the same atomic change (SPEC.md §7.1): once it's acknowledged the new document is visible and they are deleted, and a crash leaves either both or neither. Returns the new document's docId.
It is a compare-and-set: every document of docIds must still be visible when the change takes effect. When one isn't — deleted, replaced by another call first, or never stored — it throws WriteConflictException and changes nothing; a conflict known when the call starts throws before source is read. Repeated docIds count once, and with none it is an insert.
replace with the document in the file path, opened and closed by the call.
replace with the document given as a string; meant for small documents.