Please enable JavaScript.
Coggle requires JavaScript to display documents.
MongoDB Aggregation - Coggle Diagram
MongoDB Aggregation
Stage
$Sort
-
{ $sort: { <field1>: <sort order>, <field2>: <sort order> ... } }
-
$Project
$project: {<field>: 1, (1 to include)<field>: 0, (0 to exclude)<field>: <new value> (specifies for new filed and a exist field new value)
menentukan output shape,
similar to find() operations
-
-
$Group
-
{$group: { _id: <expression>, // Group key <field>: { <accumulator> : <expression> } }}
$Set
-
{ $set: { <newField>: <expression>, ... } }
- appends new fields to existing documents,
- accepts the embedding of objects
-
$Out
create a new collection from the output of pipeline,
if not exist then make new collection, if exist will replace with new data
{ $out: { db: "<output-db>", coll: "<output-collection>" } }
Definition
Stage
Salah satu metode bawaan yang dapat diselesaikan pada data, tetapi tidak mengubahnya secara permanen
-
-