Hello! So I am currently working through a Meteor tutorial and I seem to be having an issue with a Mongo collect I created with the following code:
PlayerList = new Mongo.Collection('players');
The collection itself works fine in the sense where I can manipulate it in the console and add/remove/fetch/etc. documents . However, anytime there is a refresh of the page, or I open localhost:3000 on another tab, the inserted data is not there, i.e not being persisted.
I assume this is something super simple or just some code I need to add in but Google wasnât able to help me out. So any help would be great 
How are you adding your documents to the collection? Can you post your code for doing that?
In the console Iâm doing both
PlayerList.insert({name: "Name", score: 0});
and
PlayerList._collection.insert({name: "Name", score: 0});
Both seem to produce the same results but no information persists.
Are you implying that what you inserted into the collection on the console is not persisted? Do you not get any error messages on the browser console when you refresh the page?
Yup, that is whatâs happening. And no errors are reported. And when I check the collectionâs contents in the console in a new tab or after a page refresh it shows as empty.
Are you sure that youâre subscribed to receive the documents? Turn on auto publish to automatically get all documents from the server. It just sounds like youâre not pub/subbing correctly.
Never turned auto publish off, but also never did anything really involving publishing/subbing yet.
Did you try to use db.players.insert({âŚ}) on the command line?
Doing that gives me an error of âdb is undefinedâ.
In another terminal window, go to your project directory and type âmeteor mongoâ (without the quotes) and press enter. Then enter the query and it should work.
1 Like
Still getting the same error 
HOWEVER >> Doing
PlayerList.insert({name:"Name", score: 0})
is now working properly after typing in what you recommended in the terminal (meteor mongo).
Thank you! 
I am glad you got it sorted out.
1 Like
itâs always good to see a Padawan can call call for help from his Jedi Master⌠
1 Like