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

insertOne

fun <reified T : Any> MongoCollection<T>.insertOne(document: String, options: InsertOneOptions = InsertOneOptions()): Completable (source)

Inserts the provided document. If the document is missing an identifier, the driver should generate one.

Parameters

document - the document to insert

options - the options to apply to the operation

fun <reified T : Any> MongoCollection<T>.insertOne(clientSession: ClientSession, document: String, options: InsertOneOptions = InsertOneOptions()): Completable (source)

Inserts the provided document. If the document is missing an identifier, the driver should generate one.

Parameters

clientSession - the client session

document - the document to insert

options - the options to apply to the operation