Closed ashishapy closed 8 years ago
Maybe the filter is not correct, try:
{ $or: [{ roles: { $ne: 'default' } }, { roles: { $exists: true } }] }
Thanks @nicolaslopezj .
I tried $and as below & it worked.
{ $and: [{ roles: { $ne: 'default' } }, { roles: { $exists: true } }] }
But still I don't understand if I have only 7 users in db & all user has role assigned.
so this { roles: { $ne: 'default' } }
should work.
Two were having role as 'default'. Only those users were coming as 'undefined' in the list .
Sometimes I see some values like 'Loading...' as well. Not sure but seems some bug.
You can try to debug the query in the console, like this
Meteor.users.find({ roles: { $ne: 'default' } }).fetch()
After updating nicolaslopezj:roles 2.0.4 orionjs:relationships 1.7.0 and others
below code is also returns list of user (as 'undefined') having 'default' user role.