Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- db.getCollection('productHistory').aggregate([
- {$project: {info: 0, reviewCount: 0}},
- {$match: {$and: [{timestamp:{$gt:1584447776161, $lte:1584451376161}}]}},
- {$sort: {timestamp:-1}},
- {$group:{_id:"$productId", timestamp:{$first:"$timestamp"}, widgets:{$first:"$widgets"}, }},
- {$match: {"widgets.products":"B074F1RWV9"}},
- ])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement