-
Notifications
You must be signed in to change notification settings - Fork 710
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
FIO-5471: Remove mongoose.save from codebase #1632
FIO-5471: Remove mongoose.save from codebase #1632
Conversation
…ongoose.save-from-codebase
FIO-5471: Add $set operator for mongoDb methods
e1fc7db
to
066d101
Compare
if (!item) { | ||
return Resource.setResponse(res, {status: 404}, next); | ||
} | ||
|
||
item.set(update); | ||
options.hooks.put.before.call( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did we remove the "options.hooks.put.before" hook?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@travist in that case 'before' hook was just marking 'data' as modified, which is not necessary after moving from .save()
to .findOneAndUpdate()
. And the 'after' hook was just calling next()
. Here are the screenshots of those hooks:
If there's a possibility to pass custom hooks to formio that override current ones, please tell me, I'll return those calls then.
👍 |
* FIO-5471: Removed mongoose.save from codebase * FIO-5471: Add small fixes * refactor submission patch * fix formatting * This is a combination of 2 commits. FIO-5471: Add $set operator for mongoDb methods --------- Co-authored-by: Travis Tidwell <travis@form.io>
Link to Jira Ticket
https://formio.atlassian.net/browse/FIO-5471
Description
What changed?
Refactored code to not use
mongoose.save()
Dependencies
formio-server:1082
How has this PR been tested?
Mostly by running tests
Checklist: