suspend fun insertOne(document: T, options: InsertOneOptions = InsertOneOptions()): InsertOneResult
(source)
Inserts the provided document. If the document is missing an identifier, the driver should generate one.
document
- the document to insert
options
- the options to apply to the operation
com.mongodb.DuplicateKeyException or com.mongodb.MongoException
Since
1.2
suspend fun insertOne(clientSession: ClientSession, document: T, options: InsertOneOptions = InsertOneOptions()): InsertOneResult
(source)
Inserts the provided document. If the document is missing an identifier, the driver should generate one.
clientSession
- the client session with which to associate this operation
document
- the document to insert
options
- the options to apply to the operation
com.mongodb.DuplicateKeyException or com.mongodb.MongoException
Mongodb
.server.release 3.6
Since
1.7