Meteor-Community-Packages / mongo-collection-instances

🗂 Meteor package allowing Mongo Collection instance lookup by collection name

Home Page:http://packosphere.com/dburles/mongo-collection-instances

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Filtering meteor built in collections

rustanacexd opened this issue · comments

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';
}));

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

I already got it.

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