insert
fun <T : Any> insert(value: T, id: DittoDocumentID? = null, isDefault: Boolean = false): DittoDocumentID
Content copied to clipboard
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.
is Default
represents whether or not the data being inserted should be treated as default data or not. Set this to true
if you want to set a default value that you expect to be overwritten by other devices in the network. The default value is false
.