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

javascript - three.js lot of meshes optimization -

smartface.io - Proper way to change color scheme for whole application -

Email notification in google apps script -