How to access Mongo Collection by name on Meteor server-side

fnkrm Source

I am unable to find a way to access Meteor Mongo Collections server-side. From the client, I can iterate over each collection and remove specific entries:

_.forIn(global, (value, key) => { if (!!value && value instanceof Mongo.Collection && !!value._connection) { Meteor.connection._stores[value._name]._getCollection().remove({ owner: userId }); // Work client side only } });



comments powered by Disqus