rashadb
rashadb

Reputation: 2541

Inserting Data into Meteor Collections

I followed this tutorial exactly: https://www.youtube.com/watch?v=HVr02nLZ6u4 The only difference is that I tried to insert the data into a 'users' collection which already exists as confirmed by Robomongo because I have the accounts-ui and accounts-password packages installed. When I got to the end and tried to insert data into the collection, I received the following error as detailed in this first screen shot. In the second screenshot you can see that the collection exists. In the final screenshot, you can see my source code. In closing, I also tried the collection I created in the source code and it responded with "Uncaught ReferenceError: consumer is not defined" in the console. I'd prefer to insert into the users table but am OK with inserting to the consumer table I made up. Having said that, I'd appreciate solutions for both instances. Thank you!

This is the error after I followed the directions exactly

Here you can see that the 'users' collection exists

My JS source code

My HTML source code

Thanks for the help once again!

Upvotes: 0

Views: 762

Answers (1)

Kuba Wyrobek
Kuba Wyrobek

Reputation: 5273

If you want to access users collection then use Meteor.users.

Another thing is that creation of user document should be done with Accounts.createUser which comes from accounts-password package.

Upvotes: 2

Related Questions