I’ve copied the below code from the Meteor Guide into my /client/main.js file:
// Only on the client
Todos = new Mongo.Collection('Todos');
// This line is changing an in-memory Minimongo data structure
Todos.insert({_id: 'my-todo'});
// And this line is querying it
const todo = Todos.findOne({_id: 'my-todo'});
// So this happens right away!
console.log(todo);
But I’m getting the following message in my console:
Yeah, I think this article is misleading - we should make it clear that you need to pass the null to be able to insert without it trying to call the server.
Ok thanks for the replies / explanations. I’m writing a package that interfaces OpenUI5 with Meteor and it relies on named Mongo collections to access collections via dburles:collection-helpers. I was hoping to be able to have a named, client-only collection to manage UI state.
Not to worry, there are other ways to skin the cat.