I get a method not found error ,when trying to update the db

brand new project, trying to work thorugh an ebook


PlayersList = new Mongo.Collection(‘players’);
PlayersList.insert({ name: “David”, score: 1 });

In the console it get
PlayersList.insert({ name: “David”, score: 1 }); “YEK8N2KYHH2YeeHTr” debug.js:41 insert failed: Method ‘/players/insert’ not found

Is main.js on the client only? In order for this to work you need to define your collection on the server as well.

i’m reading an ebook from a previous version of meteor when there was only one main.js.

How do i do what u said?

Show the entire main.js. Don’t forget to wrap your code in triple ` back ticks so it gets nicely formatted

Try this :- PlayersList._collection.insert({ name: “David”, score: 1 });