Aggregation pipeline expression operators

The following table summarizes the key aggregation pipeline operators (https://docs.mongodb.com/manual/meta/aggregation-quick-reference/#operator-expressions) that are currently available:

Arithmetic This set currently consists of 15 basic operators, which let you perform arithmetic operations including $add, $subtract, $multiply, and so on.
Array

These operators are needed when a document contains an array property. Notable operators in this set include:

  • $in: Used to determine if a value is in an array or not
  • $size: Gives you the number of elements in the array
  • $slice: Returns a subset of the array
Boolean Used to formulate complex conditions. These include $and, $or, and $not.
Comparison ...

Get MongoDB 4 Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.