kmongo / org.litote.kmongo.coroutine / CoroutineCollection / save

save

suspend fun save(document: T): UpdateResult? (source)

Save the document. If the document has no id field, or if the document has a null id value, insert the document. Otherwise, call replaceOneById with upsert true.

Parameters

document - the document to save

suspend fun save(clientSession: ClientSession, document: T): UpdateResult? (source)

Save the document. If the document has no id field, or if the document has a null id value, insert the document. Otherwise, call replaceOneById with upsert true.

Parameters

clientSession - the client session with which to associate this operation

document - the document to save