UpsertOne
class UpsertOne<Document : Any> : AbstractBsonNode, Command, AvailableInBulkWrite<Document> (source)
Updating a single element in a collection, creating it if it doesn't exist.
Example
users.upsertOne({ User::name eq "foo" }) {
User::age set 18
}
Content copied to clipboard
External resources
See also
Filter operators
Update operators
Functions
Link copied to clipboard
Writes the result of simplifying to a new Bson.
Link copied to clipboard
Writes the result of simplifying this expression into writer.