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

Deprecation warning on update() #63

Open
amitschandillia opened this issue Sep 17, 2018 · 6 comments
Open

Deprecation warning on update() #63

amitschandillia opened this issue Sep 17, 2018 · 6 comments

Comments

@amitschandillia
Copy link

I'm using Fawn in a NodeJS project with mongoose 5.2.13. The implementation works absolutely fine, however, the update() function returns a deprecation warning:

DeprecationWarning: collection.update is deprecated. Use updateOne, updateMany, or bulkWrite instead.

Is there any way I could just use the findOneAndUpdate() function as recommended by MongoDB docs, with fawn? I even have the useMongoose argument set to true:

task.run({useMongoose: true})

Any tip will be great!

@e-oj
Copy link
Owner

e-oj commented Sep 17, 2018

Thanks for pointing that out. There's no quick fix unfortunately; I'll have to upgrade the project's version of mongoose. I'll try to do that within the next couple of weeks but transactions are now a part of the recent MongoDB version. Have you tried the native transactions?

@amitschandillia
Copy link
Author

amitschandillia commented Sep 18, 2018

Thank you for the quick response, mate! Yes, I tried my hands at the native mongoose transaction implementation as outlined here. But turns out, MongoDB Atlas cloud hosting locks you down to MongoDB version 3.6.7 for all M0 users like me. And transactions only come with version 4 upwards. So I still depend on your work (it's a lifesaver). :)

@WebbizAdmin
Copy link

Would like to see this too 👍

@e-oj
Copy link
Owner

e-oj commented Feb 3, 2019

#72

@e-oj e-oj closed this as completed Feb 3, 2019
@e-oj e-oj reopened this Feb 3, 2019
@amitschandillia
Copy link
Author

Is there any way to achieve the $ojFuture functionality using mongoose? Am asking since fawn continues to throw deprecation warnings and I do not want to burden you with repeated update requests.

@s4suryapal
Copy link

s4suryapal commented Aug 13, 2020

Still getting this WARNING:
(node:57487) DeprecationWarning: collection.update is deprecated. Use updateOne, updateMany, or bulkWrite instead.

Please help !, how to fix this ??

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

No branches or pull requests

4 participants