MongoDB $type Query Operator

In MongoDB, you can use the $type element query operator to filter a collection of documents based on BSON type. It returns just those documents that have a particular BSON type in a specific field.

You provide the field and the BSON type, and $type will return all documents that match.

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