What is a stub method in MeteorJS?
Why does including a database call make it a non-stub? Thanks!
For the above code you can write this that will be ran on both server and client, use isSimulation to identify on wich side you are if you need to do specific task :
var MyCollection = new Meteor.collection("mycoll")
Meteor.methods({
test:function() {
console.log(this.isSimulation) //Will be true on client and false on server
var colItem = {test:true, server: true};
if (this.isSimulation) {
colItem.server = false;
}
MyCollection.insert(colItem);
}
});