Meteor-Community-Packages / mongo-collection-instances

🗂 Meteor package allowing Mongo Collection instance lookup by collection name
http://packosphere.com/dburles/mongo-collection-instances
MIT License
73 stars 27 forks source link

Filtering meteor built in collections #18

Closed rustanacexd closed 9 years ago

rustanacexd commented 9 years ago

Is there any built in feature for this? basically I want to exclude the 2 pre made collections

I am trying to use underscore js here. And i'm confused why it is not working.

var arr = Mongo.Collection.getAll();
 return _.without(arr, _.filter(arr, function (item) {
                return item.name === 'users' || item.name === 'meteor_accounts_loginServiceConfiguration';
}));
dburles commented 9 years ago

I believe _.reject may be what you're after

rustanacexd commented 9 years ago

I already got it.

return _.filter(Mongo.Collection.getAll(), function (o) {
         return o.name !== 'users' && o.name !== 'meteor_accounts_loginServiceConfiguration';
});