-
-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] before_event of type Update #913
Comments
I just realized that this event can't save changes as well. |
Hi @RempelOliveira , |
Hi @roman-right, thanks for answering my question. In my opinion, if the Insert/Replace event can access the data sent in the request and can change them before creating the record in the database, the Update event should also. This implementation is very partial if it was only designed to allow doing any something else not related to the operation itself. In fact, events of this type in other ODMs usually allow us to do exactly what I described. The documentation itself suggests that these events are used to change data before saving or updating it. |
🤯 I just also ran into this issue. I'm fairly sure this worked on a previous version; did something change? |
This issue is stale because it has been open 30 days with no activity. |
This issue was closed because it has been stalled for 14 days with no activity. |
Describe the bug
When using "before event" of type "Updated", the values of the fields in the "self" variable aren't the values passed in the request, they are the values readed from the database.
To Reproduce
Expected behavior
My understanding is that this event serves to manipulate the input data before being inserted into the database, however, only when using the "Replace" type is it possible to have access to them, but I wouldn't like to use replace because I just need to update a few fields, not all the collection.
Additional context
My understanding is that this event serves to manipulate the input data before being inserted into the database, however, only when using the "Replace" type is it possible to have access to them, but I wouldn't like to use replace because I just need to update a few fields, not all the collection.
Using this event with "Insert" I can also access the request data, I can't only using "Update" ;/
Am I wrong about how I see this feature or is it a bug?
If it is the expected behavior, how can I do something like the example provided?
The text was updated successfully, but these errors were encountered: