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
Post a Comment