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

add return value to bulk replaceOne #2364

Closed
wants to merge 1 commit into from
Closed

Conversation

wmestrom
Copy link

@wmestrom wmestrom commented May 13, 2020

Description

Without a return value we can't use fluid bulk syntax with replaceOne statements. Example:

ops
  .find({ _id: 1}).upsert().replaceOne({ _id: 1, value: 2 })
  .find({ _id: 2}).upsert().replaceOne({ _id: 2, value: 1 })

What changed?

Added return statement to replaceOne()

Are there any files to ignore?

No

Without a return value we can't use fluid bulk syntax with replaceOne statements. Example:
ops.find({ _id: 1}).upsert().replaceOne({ _id: 1, value: 2 }).find({ _id: 2}).upsert().replaceOne({ _id: 2, value: 1 })
@wmestrom
Copy link
Author

This doesn't seem to fix the problem, fluid syntax is actually broken in multiple ways.
updateOne is also broken, although it does return a value it is not of the correct type resulting in runtime errors.

@mbroadst
Copy link
Member

Thanks @wmestrom , I made this ticket to track considering this for the next breaking change.

@mbroadst mbroadst closed this Jul 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants