MongoDB $bsonSize

From MongoDB 4.4, you can use the $bsonSize aggregation pipeline operator to return the size of a given document in bytes.

$bsonSize accepts any valid expression as long as it resolves to either an object or null

Read more

MongoDB $binarySize

From MongoDB 4.4, you can use the $binarySize aggregation pipeline operator to return the size of a given string or binary data value’s content in bytes.

It accepts any valid expression as long as it resolves to either a string or binary data value. The argument can also be null, in which case, $binarySize returns null.

Read more

MongoDB $rtrim

In MongoDB, the $rtrim aggregation pipeline operator removes whitespace from the end of a string. This includes the null character.

It can also remove any character specified. For example, you could use it to remove all periods (.), exclamation marks (!), etc from the end of a string.

Read more

MongoDB $ltrim

In MongoDB, the $ltrim aggregation pipeline operator removes whitespace from the beginning of a string. This includes the null character.

It can also remove any character specified. For example, you could use it to remove all hyphen characters (-) from the beginning of a string.

Read more

MongoDB $trim

In MongoDB, the $trim aggregation pipeline operator removes whitespace from the beginning and end of a string. This includes the null character.

It can also remove any character specified. For example, you could use it to remove all hyphen characters (-) or periods (.) or all s characters, etc.

Read more