Jesus Nana
Jesus Nana

Reputation: 131

In MeteorJs how do I refer to an existing mongo collection?

I'm using alanning:roles module, this creates 'roles' collection. How do I reference that collection on my application?

Basically what I'm trying to do is fetch a single role based on role._id. ie. roles.findOne('idhere');

Looking at the alanning:roles docs, they didn't include an api to get by id.

Thanks!

Upvotes: 0

Views: 44

Answers (1)

arjun ghevariya
arjun ghevariya

Reputation: 41

You can access Roles collection via

Meteor.roles.findOne({_id:'yourID'});

Snapshot of how can you check if it works via console

Upvotes: 4

Related Questions