DocumentDB LogoDocumentDB
HomeGitHubDiscordDocsPackagesBlogs
Back to DocumentationMQL Documentation
Commands
Aggregation
Query And Write
Operators
Accumulators
Aggregation
Arithmetic Expression
Array Expression
Array Query
Array Update
Bitwise
Bitwise Query
Bitwise Update
Comparison Query
Conditional Expression
Data Size
Date Expression
Element Query
Evaluation Query
Field Update
$currentDate
$inc
$mul
$rename
$setOnInsert
Geospatial
Literal Expression
Logical Query
Miscellaneous
Miscellaneous Query
Object Expression
Projection
Set Expression
Timestamp Expression
Variable Expression
Window Operators
Reference/Operators/Field Update

MongoDB Query Language (MQL) Field Update Operators

Field update operators modify field values within documents during update operations. These operators enable you to set, unset, rename, increment, multiply, and perform other field-level modifications, providing precise control over document structure and content updates.

$currentDate

The $currentDate operator sets the value of a field to the current date, either as a Date or a timestamp.

$inc

The $inc operator increments the value of a field by a specified amount.

$mul

The $mul operator multiplies the value of a field by a specified number.

$rename

The $rename operator allows renaming fields in documents during update operations.

$setOnInsert

The $setOnInsert operator sets field values only when an upsert operation results in an insert of a new document.

Copyright © DocumentDB a Series of LF Projects, LLC. For web site terms of use, trademark policy and other project policies please see https://lfprojects.org.