Meteor JS : How to make a query that finds all contained values in an array using the MongoDB ?

MongoDB operator : $in

Syntax : Collection.find({attribute:{$in:array}});

Example :

    var event = Events.findOne({_id:id});
    if ( event.attractions ){
        var att = [];
        event.attractions.forEach(function(entry) {
            if (entry.artist){
    return Meteor.users.find({_id:{$in:att}});

1 Comment

  1. I truly enjoy looking at on this web site , it contains superb blog posts. Heavierthanair flying machines are impossible. by Lord Kelvin. efecbcdkgfacfced


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s