Skip to content
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

Several problems about shell and node-mongodb-native compatibility #109

Closed
Fonger opened this issue Jul 31, 2018 · 2 comments
Closed

Several problems about shell and node-mongodb-native compatibility #109

Fonger opened this issue Jul 31, 2018 · 2 comments
Milestone

Comments

@Fonger
Copy link
Contributor

Fonger commented Jul 31, 2018

I would like to discuss some problems I found so far

  1. mquery calls findAndModify internally to support findOneAndUpdate and findOneAndRemove.
    findAndModify has been marked as deprecated since node-mongodb-native 2.2. mquery has mongodb dependency 2.2+ so we should update it even though the latest 3.1 still supports findAndModify.

  2. Returning modified document after update: new vs returnOriginal vs returnNewDocument

  3. In mongo shell and node-mongodb-native, there is no findOneAndRemove. Only findOneAndDelete method exists. Should we add findOneAndDelete as alias to avoid confusion?

  4. Add findOneAndReplace Add support for findOneAndReplace? #104 I don't know how to use findAndModify to implement findOneAndReplace. Maybe just call findOneAndReplace from node-mongodb-native like point 1. suggests?

@Fonger Fonger changed the title Several problems about compatibility Several problems about shell and browser compatibility Jul 31, 2018
@aheckmann
Copy link
Collaborator

aheckmann commented Jul 31, 2018 via email

@Fonger Fonger changed the title Several problems about shell and browser compatibility Several problems about shell and node-mongodb-native compatibility Jul 31, 2018
@vkarpov15
Copy link
Member

  1. Mongoose has a flag to work around this, we should add a similar one to mquery
  2. We should add support for returnOriginal
  3. findOneAndDelete should be separate, not just an alias, because findOneAndDelete should not use findAndModify
  4. findOneAndReplace should not use findAndModify

@vkarpov15 vkarpov15 added this to the 4.0.0 milestone Jun 5, 2021
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

No branches or pull requests

3 participants