This article contains a list of date operators, methods, and variables that you can use when working with dates in MongoDB.
Continue readingTag: operators
MongoDB $toUpper
In MongoDB, the $toUpper
aggregation pipeline operator converts a string to uppercase and returns the result.
MongoDB $toLower
In MongoDB, the $toLower
aggregation pipeline operator converts a string to lowercase and returns the result.
MongoDB $exists
In MongoDB, you can use the $exists
element query operator to match documents that contain a specific field.
You can also use it to match documents that don’t contain a specific field.
You can also use it in conjunction with other operators such $nin
to match documents where a given field exists, but it doesn’t contain a specific value.
MongoDB $isNumber
From MongoDB 4.4, you can use the $isNumber
aggregation pipeline operator to check whether or not a value is a number.
It accepts any valid expression, and returns true
if the expression is a number, false
if it’s not.
MongoDB $replaceAll
The $replaceAll
aggregation pipeline operator was introduced in MongoDB 4.4.
This operator replaces all instances of a search string in an input string with a replacement string and returns the result.
If the search string isn’t found, then $replaceAll
returns the input string.
MongoDB $replaceOne
The $replaceOne
aggregation pipeline operator was introduced in MongoDB 4.4.
This operator replaces the first instance of a search string in an input string with a replacement string and returns the result.
If the search string isn’t found, then $replaceOne
returns the input string.
MongoDB $last Aggregation Pipeline Operator
MongoDB 4.4 introduced the $last
aggregation pipeline operator.
This operator returns the last element in an array.
Continue readingMongoDB $first Aggregation Pipeline Operator
MongoDB 4.4 introduced the $first
aggregation pipeline operator.
This operator returns the first element in an array.
Continue readingMongoDB $arrayElemAt
In MongoDB, the $arrayElemAt
aggregation pipeline operator returns the element at the specified array index.
It accepts two arguments;
- The array
- The index of the element you want to retrieve