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

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -