socket.io - how to emit mongoose event findOneAndUpdate in angular-fullstack? -


angular-fullstack emits document.post('save'); out of box . im trying listen findoneandupdate dont know how cannot find event mongoose triggers listened , emitted accordingly.

you need register hook before compiling model (i.e. calling .model()).

from documentation:

the .model() function makes copy of schema. make sure you've added want schema before calling .model()!

i'd suggest export schema module, register hooks on , call .model() afterwards.


Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -