meteor - Object has no method findOne, after Insert hook -
this curious.
i created hook update data of related collections after update. code this:
@votes.after.insert (userid, doc) -> person = people.findone name: doc.candidate person.votes += 1
when insert new vote works fine: hook called , votes updated fine. got on server log:
exception while invoking method '/votes/insert' typeerror: object [object object] has no method 'findone'
and on console of browser:
errorclass {error: 500, reason: "internal server error", details: undefined, message: "internal server error [500]", errortype: "meteor.error"}
i didn't understand why got errors if worked fine.
Comments
Post a Comment