save

expect fun save(document: MutableDocument)(source)

Save a document into the collection. The default concurrency control, lastWriteWins, will be used when there is conflict during save.

When saving a document that already belongs to a collection, the collection instance of the document and this collection instance must be the same, otherwise, the InvalidParameter error will be thrown.


expect fun save(document: MutableDocument, concurrencyControl: ConcurrencyControl): Boolean(source)

Save a document into the collection with a specified concurrency control. When specifying the failOnConflict concurrency control, and conflict occurred, the save operation will fail with 'false' value returned. When saving a document that already belongs to a collection, the collection instance of the document and this collection instance must be the same, otherwise, the InvalidParameter error will be thrown.


expect fun save(document: MutableDocument, conflictHandler: ConflictHandler): Boolean(source)

Save a document into the collection with a specified conflict handler. The specified conflict handler will be called if there is conflict during save. If the conflict handler returns 'false', the save operation will be canceled with 'false' value returned.

When saving a document that already belongs to a collection, the collection instance of the document and this collection instance must be the same, otherwise, the InvalidParameter error will be thrown.

actual fun save(document: MutableDocument)(source)
actual fun save(document: MutableDocument, conflictHandler: ConflictHandler): Boolean(source)
actual fun save(document: MutableDocument)(source)
actual fun save(document: MutableDocument, concurrencyControl: ConcurrencyControl): Boolean(source)
actual fun save(document: MutableDocument, conflictHandler: ConflictHandler): Boolean(source)