Reference/Operators/Data SizeMongoDB Query Language (MQL) Data Size OperatorsData size operators are used to determine the size of data structures and values.$binarySizeThe $binarySize operator is used to return the size of a binary data field.$bsonSizeThe $bsonSize operator returns the size of a document in bytes when encoded as BSON.
Reference/Operators/Data SizeMongoDB Query Language (MQL) Data Size OperatorsData size operators are used to determine the size of data structures and values.$binarySizeThe $binarySize operator is used to return the size of a binary data field.$bsonSizeThe $bsonSize operator returns the size of a document in bytes when encoded as BSON.