I want to create a demo app in which, on startup, if no docs exist in a collection, a single doc is created that the user can play with. I cannot allow multiple instances to be created (for the purposes of the demo.)
However, while I can easily create the item on the server side, it is not clear how I can find it on the client side. For example:
if(Meteor.isServer){
if(Items.find().count() === 0){
item = Items.insert({title: "My Item"});
}
}
How can I now locate this item
by id on the client side?
I have tried using export/import, but I get undefined when I try to import from the server to the client.