Need help count users in some roles


Hi all,

I use Alanning Roles with default-group. I have users with the following roles:

  • admin
  • manager
  • appuser

I need to count users in “admin” and “manager” exclude “appuser”.

How to do it correctly? Please advice, thank you.

Meteor.users.find({ "roles": 
    { "default-group": [ "admin"] } 

This is the most I can reach. I can’t go any further getting what I need without getting query error.

I tried:

Meteor.users.find({ "roles": 
    { "default-group": { $in: [ "admin", "manager" ] } } 

No code error but get zero return. Please advice, thanks.


You were almost there. The field reference was wrong:

  "roles.default-group": { 
    $in: [ "admin", "manager" ], 
    $nin: ["appuser"],


Thank you very very much… Appreciated…