zakodium / adonis-mongodb

MongoDB provider for AdonisJS 5
https://zakodium.github.io/adonis-mongodb/
Other
63 stars 12 forks source link

Aggregations #73

Open targos opened 3 years ago

riveraser commented 3 years ago

Please, any feedback about aggregations? I did a full model.query({...}) and it works! Bu I did not find mode.aggregation({}) ... thanks for your work

targos commented 3 years ago

Hello, nothing yet directly from the Model, but you can already do aggregations using the Collection object:

const collection = await Model.getCollection();
collection.aggregate(...)

https://mongodb.github.io/node-mongodb-native/4.1/classes/Collection.html#aggregate