![]() MongoDB also supports same concept in aggregation framework. ![]() In UNIX command, shell pipeline means the possibility to execute an operation on some input and use the output as the input for the next command and so on. Now from the above collection, if you want to display a list stating how many tutorials are written by each user, then you will use the following aggregate() method − In the collection you have the following data −ĭescription: 'MongoDB is no sql database',ĭescription: 'No sql database is very fast', >db.COLLECTION_NAME.aggregate(AGGREGATE_OPERATION) Syntaxīasic syntax of aggregate() method is as follows − The aggregate() Methodįor the aggregation in MongoDB, you should use aggregate() method. In SQL count(*) and with group by is an equivalent of MongoDB aggregation. Aggregation operations group values from multiple documents together, and can perform a variety of operations on the grouped data to return a single result. ![]() Aggregations operations process data records and return computed results.
0 Comments
Leave a Reply. |