Is aggregation operations seen as writes ? or reades?

in the course M320, first chapter last lesson. the instructor points out that the aggregation is a write operation, can someone please explain why is it a write?

Hi @Abdullah_Alfadhel,

The use of “aggregate” in this example is rather overloaded as there is both the general verb describing gathering data and the product feature of MongoDB’s Aggregation Framework.

In this example:

  • The Ops task of “aggregate data per hour” is referring to creating a collection of aggregated data per hour based on device_id and metrics values. It would be clearer to refer to this as pre-aggregated data, similar to the Bucket Pattern.

  • The Data Scientist task of “analytic queries per hour” is running read-only queries on metrics and pre-aggregated metrics. These can use standard queries or the Aggregation Framework.

  • In practice the Aggregation Framework can be used for both reading and writing of data. The final stage of an aggregation pipeline can be $out or $merge, and starting in MongoDB 4.2 you can Use an Aggregation Pipeline for Update Operations.

Regards,
Stennie

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.