You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I have been using moleculer-db with the mongoose adapter successfully for several months now. I am not sure why this issue is just now showing itself, but I have noticed two potential problems, one in the adapter and one in the core db service code.
In _update() you call beforeEntityChanged()here, but there is not corresponding call to entityChanged()` at the end of the function.
In the mongoose adapter the method updateById() returns a Query object. For some reason I just started having to explicitly call exec() on the returned query to get a doc that I can send to transformDocuments(), otherwise I was getting the error enity.toJSON() is not a function.
Note that I use _update() (or the update action) when possible, however, there are cases where I need to do a more complicated update operation than what the db adapter supports and I call updateById directly and then call transformDocuments.
Any ideas if either of these are actual bugs in the code, or is this working as intended and I am must have done something else that broke things.
The text was updated successfully, but these errors were encountered:
Hi, I have been using moleculer-db with the mongoose adapter successfully for several months now. I am not sure why this issue is just now showing itself, but I have noticed two potential problems, one in the adapter and one in the core db service code.
beforeEntityChanged()
here, but there is not corresponding call to entityChanged()` at the end of the function.updateById()
returns aQuery
object. For some reason I just started having to explicitly callexec()
on the returned query to get a doc that I can send totransformDocuments()
, otherwise I was getting the errorenity.toJSON() is not a function
.Note that I use
_update()
(or theupdate
action) when possible, however, there are cases where I need to do a more complicated update operation than what the db adapter supports and I callupdateById
directly and then calltransformDocuments
.Any ideas if either of these are actual bugs in the code, or is this working as intended and I am must have done something else that broke things.
The text was updated successfully, but these errors were encountered: