Why would this not work?:
On both the client and server:
AllUsers = new Meteor.Collection(\'allUsers\');
On the server only:
Meteor collections defined on the server have a 1:1 relationship with collections in the database. You don't have a collection in the DB called 'allusers'
, so that definition doesn't make sense. It seems like you are confusing the notion of a database collection and a published result set.
When you add the accounts package to your project, meteor defines the Meteor.users
collection for you on both the client and the server, so you don't need to do that again. Your code looks fine - just remove the new Meteor.Collection
and access the users via Meteor.users.find
.
Meteor.users
is created by the accounts
packagedb.users
. You can make this collection look like the others you define by doing something like Users = Meteor.users
, and later calling Users.find()
instead of Meteor.users.find()
.new Meteor.Collection('rooms')
'rooms'
is the name of the collection in the database (db.rooms
). Documents can be published from the server to the client.new Meteor.Collection('userCount')
'userCount'
does not correspond to the name of a DB collection, but instead is simply an identifier agreed upon by the client and server.new Meteor.Collection(null)