If you’ve removed the insecure package from your app, client side writes are denied by default
Though going by the error you probably aren’t running the code that creates the collection on the server, make sure the new Mongo.Collection(‘players’); line is run on both server and client
Just ensure that your const PlayersList = new Mongo.Collection('players'); line is put in a file containing your server code (like server/main.js) and also a file containing your client code (like client/main.js).
If you’re using import syntax, you’ll do this slightly differently, but the basic principle is to ensure that any code which needs to run on client and server is present on client and server.
I’m trying to learn meteor from a tutorial. Every time I try to work interact with mongo from console panel I face a new problem and it waste my time!!
Because the variable has been set without using var, it will be globally scoped and available in all your other files. (This is considered bad practice for larger apps, but is fine for this example. It’s worth learning the import/export syntax later on too)
With that done (and with the insecure package installed), you can just use PlayersList directly in client/main.js
You mean I create a folder with name of both and place a javascript page with name of collections inside it and this will handles both server and client.