Replies: 1 comment
-
Unfortunately not. The MongoDB server only returns the document before or the document after; no way to get the MongoDB server to return both. Your best bet would be to get the document before, and then calculate the updated document. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi-
Trying to be efficient in some
upsert
operations..So for new documents inserted, its not a problem because I know its "updatedExisting = false.
But when Im actually doing a true update, it would be great to get the old document and the new document from Mongo.
I can probably just calculate it, but trying to find out is there an option in Mongoose that returns both old and new documents at the same time?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions