Skip to content

Initial commit#25

Open
mikeshhoffman wants to merge 1 commit intopce-uw-jscript400:masterfrom
mikeshhoffman:master
Open

Initial commit#25
mikeshhoffman wants to merge 1 commit intopce-uw-jscript400:masterfrom
mikeshhoffman:master

Conversation

@mikeshhoffman
Copy link

No description provided.


(I coded both calls.)

updateOne returns the _old document_. The other method returns the new document.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not quite true. .updateOne() will return meta information about the update, while .findOneAndUpdate() will return the old document.


* **Your Answer:**


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding the option { new: true } will return the newer document.


* **Your Answer:**


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated_at should have been updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants