-
-
Notifications
You must be signed in to change notification settings - Fork 90
How to intercept & change set behavior? #180
Comments
Could you reformat your code or post it elsewhere? It's hard to follow it, because the indentation is broken and there's no spacing. |
@vadimdemedes Sorry, added some annotations and a demo, hope it would be more clear. |
This is a good point, perhaps we'll need to introduce a specific action to dispatch on model initialization, like |
@vadimdemedes I find out the feature I need is actual the virtual field feature in mongoose, and if I using another field name that doesn't exist in database, the problem solved. |
But to solve the problem that there isn't a way to intercept query and persistence, I think we should let the models query from database using another action to initial, like |
I want to intercept get & set action to make the field value different in using & store, here are my code:
Then I reallize SET action is not only used by outside, but also inside when query from the db (in the constructor), so I couldn't tell which action is triggered by user input or query from the db.
The text was updated successfully, but these errors were encountered: