Asya
Asya
Nov 1 · 1 min read

I’m curious why use aggregation pipeline rather than using $expr in find? (New since 3.6 but that was quite a while ago)

Your query is then just

db.collection.find({

purchasedEvents: { $in:purchasedEvents },

$expr:{$gt:[ {$size: {$setIntersection: [‘$purchasedEvents’, purchasedEvents]}}, 2] }

})

    Asya

    Written by

    Asya

    Frequent fliers know there are lie-flat options in coach too. I'm also on http://askasya.com and mongodb-user google group, and many MongoDB meetups.