upsert
fun <T : Any> upsert(value: T, writeStrategy: DittoWriteStrategy = DittoWriteStrategy.Merge): DittoDocumentID
Content copied to clipboard
Inserts a new document into the collection and returns its ID. If the document already exists, the behavior is determined by the given writeStrategy
.
Return
the ID of the inserted document.
Parameters
value
the value to insert into the collection.
write Strategy
specifies the desired strategy for inserting a document. The default value is DittoWriteStrategy.Merge
.