OK, so I’ve installed Differential Boilerplate and Robomongo (shouldn’t have to be relevant, but I mention it nevertheless). I’ve tried to create new collections inside Boilerplate and I couldn’t. Created a new basic Meteor project, copied code from first couple of steps of Meteor To-do tutorial, it doesn’t create a collection.
I can’t create a collection whatever I do, I can only access the ones I created before Differential and Robomongo. No errors in terminal.
What on earth could be the matter? I would open an issue on Differential GitHub, but I can’t believe this could be the cause.
Your code needs to be under a server/ folder, or in a shared location (like lib/). If it’s under a client/ folder, or in a Meteor.isClient block it won’t create a collection in MongoDB.
In this case, you will need db and db.tasks defined to be visible to the server.
In Boilerplate it was under both/, in this simple app I don’t have any folders and not in .isClient. I’m aware databases have to be both server & client. I had no problems creating databases in Meteor before, problem started today after Boilerplate and Robomongo.
Interestingly, this was my issue. For weeks I’ve been scouring forums to fix the error of “Cannot Perform Insert On Undefined” from the CFS Autoform. The answer was to move the code which initializes the CollectionFS into the shared “lib” folder.
Thumbs = new FS.Collection("thumbs",{
stores: [new FS.Store.FileSystem("thumbs",{path:"~/uploads"})]
});