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.

Read more

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.

Read more

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.

Read more