DocumentDB LogoDocumentDB
HomeGitHubDiscordDocsBlogs
Back to DocumentationMQL Documentation
CommandsAggregationQuery And Write
OperatorsAccumulatorAggregationArithmetic ExpressionArray ExpressionArray QueryArray UpdateBitwiseBitwise QueryBitwise UpdateBoolean ExpressionComparison QueryConditional ExpressionData SizeDate ExpressionElement QueryEvaluation QueryField UpdateGeospatialLogical QueryMiscellaneousObject ExpressionProjectionSet ExpressionTimestamp ExpressionVariable ExpressionWindow
Reference/Operators/Miscellaneous

MongoDB Query Language (MQL) Miscellaneous Operators

$comment

Adds a comment to a query without affecting the query execution, useful for documentation and debugging purposes.

$getField

Returns the value of a specified field from a document, with support for dynamically determined field names using expressions and variables.

$natural

Controls the order in which documents are returned by specifying natural order (insertion order) or reverse natural order.

$rand

Returns a random floating-point number between 0 and 1, useful for random sampling and generating random values in aggregation pipelines.

$sampleRate

Randomly selects documents from the input at the specified rate, useful for sampling large datasets or creating representative subsets for analysis.

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.