Filtering users collection


#1

Good afternoon! I have a users collection with data in it (created using accounts-password package) and I want to display user info in a list and then filter based on checkboxes and dropdowns (similar to match.com or some other service like that). The issue I am running into following the steps outlined here: https://github.com/ericchen0121/filter-collections/
Following the code examples I get the following:

Server side
Meteor.FilterCollections.publish(users, { name: 'list', callbacks: {/*...*/} });

Client side
UserFilter= new Meteor.FilterCollections(users, { template: 'list' // Other arguments explained later. See Configuration. });
Note: I am NOT specifying the below because that is already created with the accounts-password package.
Users= new Meteor.Collection("users");

I am getting the error: “users is not defined”. Any help on this? Is this package compatible with accounts-password package?

When I try and “define” it using
Users= new Meteor.Collection("users");
I get the error: “collection users already exists.” What am I doing wrong?


#2

Bump. Can anyone help?


#3

Could someone help out? Do you need more info? Would be much appreciated.


#4

If you are trying to query the users that are created using the default Accounts module, you can do the following:

Meteor.users.find({ favoriteColor: 'blue' });

Not sure what you’re trying to accomplish with the filter-collections, but hopefully this helps?