Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 422 Bytes

documents.md

File metadata and controls

26 lines (20 loc) · 422 Bytes

Demo for Documents

Example of code

import {AggregateBuilder} from 'mongodb-aggregate-builder';


const aggBuilder = new AggregateBuilder();
aggBuilder.documents([ { x: 10 }, { x: 2 }, { x: 5 } ]);
console.log(JSON.stringify(aggBuilder.build(), null, 2));

Result

[
    {
        "$documents": [
            {"x": 10},
            {"x": 2},
            {"x": 5}
        ]
    }
]