I'm using validated-method to created an insert method but it crash to run meteor
export const hasAtLeastOnePenpal = new ValidatedMethod({
name: 'hasAtLeastOnePenpal',
validate: new SimpleSchema({
id: { type: String }
}).validator(),
run(id) {
return Tandems.collection.find({interlocutors: id}).count() > 0
}
});
I'm using validated-method to created an insert method but it crash to run meteor