kmongo / org.litote.kmongo.rxjava2 / com.mongodb.reactivestreams.client.MongoCollection / save

save

fun <T : Any> MongoCollection<T>.save(document: T): Completable (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

fun <T : Any> MongoCollection<T>.save(clientSession: ClientSession, document: T): Completable (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

document - the document to save