samedi 4 août 2018

MongoDB aggregate complexity or cpu usage analysis using $match and $sample

I have this code in my mongoDB trying to get random sample of data and hence I would like to know the complexity and CPU usage if my total document is greater than 1 million _id is indexed:

contents.aggregate([{ $match: { "language": lang } }, { $sample: { size: limit } }, { $project: { 'answers': 0, 'processing': 0 } } ], callback)




Aucun commentaire:

Enregistrer un commentaire