Repository navigation
fix(server): use returnDocument 'after' instead of deprecated new: true - #107
Merged
SahinurDEV merged 1 commit intoNov 19, 2026
Merged
Conversation
👷 Deploy request for frolicking-cascaron-4fab1f pending review.Visit the deploys page to approve it
|
6 tasks done
Owner
|
Merged — thank you @O1sumitkumar for the clean fix, the clear verification notes and the changelog entry! 🎉 This closes #103. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Replaces the deprecated Mongoose
{ new: true }option with{ returnDocument: 'after' }in the two update calls that used it:server/src/controllers/formController.ts(updateForm,Form.findOneAndUpdate)server/src/controllers/userController.ts(updateProfile,User.findByIdAndUpdate)Behaviour is unchanged (both still return the updated document); this just removes the
[MONGOOSE] Warning: ... the \new` option ... is deprecatedmessage. Added a line under[Unreleased]→FixedinCHANGELOG.md`.Related issues
Fixes #103
Type of change
How verified
pnpm -F @form-builder/server test: before the change, 22/22 passed but the deprecation warning was printed 3 times; after, 22/22 passed with no[MONGOOSE]warning. The existing testsstill lets the owner edit, read responses and delete(forms) andstill updates the name(profile) assert the response carries the updated values, soreturnDocument: 'after'is exercised for both calls.pnpm -F @form-builder/server exec tsc --noEmit: clean.pnpm format:check: all files pass.Checklist
pnpm -F @form-builder/server exec tsc --noEmit)..envfiles, or debugconsole.logs are committed.