mongodbmongodb-compass

Can the "Aggregations" tab in MongoDB Compass alter original documents?


Is there a risk of unintended modification to original documents when using the "Aggregations" tab in MongoDB Compass? I want to ensure that my data remains unchanged and intact throughout the aggregation process.

MongoDB Compass for Mac, version 1.38.0

MongoDB Compass tabs


Solution

  • According to official docs it says:

    Aggregation pipelines run with the db.collection.aggregate() method do not modify documents in a collection, unless the pipeline contains a $merge or $outstage.

    Also since MongoDB 4.2 you can use aggregations pipeline into update queries, but that's not the point.