insertWithStrategy

fun <T : Any> insertWithStrategy(value: T, id: DittoDocumentID? = null, writeStrategy: DittoWriteStrategy = DittoWriteStrategy.Overwrite): DittoDocumentID

Inserts a document into the scoped collection and returns the document's ID.

Return

the ID of the inserted document.

Parameters

value

the ID to use for the document. If null then Ditto will automatically assign an ID.

writeStrategy

specifies the desired strategy for inserting a document. The default value is DittoWriteStrategy.Overwrite.