InsertOne¶
class InsertOne<Document : Any> : Command, AbstractBsonNode, AvailableInBulkWrite<Document>
Inserting a single element in a collection.
Example¶
External resources¶
See also¶
InsertManyInsertOneOptions: Options
Constructors¶
InsertOne¶
constructor(
context: BsonContext,
document: Document,
documentType: KType
)
Properties¶
context¶
@LowLevelApi
open val context: BsonContext
The context used to generate this expression.
document¶
documentType¶
val documentType: KType
options¶
val options: InsertOneOptions<Document>
Functions¶
freeze¶
@LowLevelApi
open override fun freeze()
Makes this expression immutable.
simplify¶
@LowLevelApi
open fun simplify(): AbstractBsonNode?
Returns a simplified (but equivalent) expression to the current expression.
toBson¶
@LowLevelApi
open fun toBson(): BsonDocument
Writes the result of simplifying to a new BsonDocument.
toString¶
writeTo¶
@LowLevelApi
override fun writeTo(writer: BsonFieldWriter)
Writes the result of simplifying this expression into writer.