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/Data Size

MongoDB Query Language (MQL) Data Size Operators

$binarysize

The `$binarySize` operator is used to return the size of a binary data field. This can be useful when dealing with binary data stored, such as images, files, or any other binary content.

$bsonsize

The `$bsonSize` operator is used to return the size of a document in bytes when encoded as BSON. It's useful for understanding the storage requirements of documents within your collections.

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.