DeviaVir / zenbot

Zenbot is a command-line cryptocurrency trading bot using Node.js and MongoDB.
MIT License
8.22k stars 2.04k forks source link

(node:106467) DeprecationWarning: collection.save is deprecated. Use insertOne, insertMany, updateOne, or updateMany instead. #2607

Open reynard80 opened 3 years ago

reynard80 commented 3 years ago

System information

Describe the problem

When starting zenbot, I get a DepreactionWarning about collection.save. Should I use an older version of mongodb?

Source code / Error logs

(node:106467) DeprecationWarning: collection.save is deprecated. Use insertOne, insertMany, updateOne, or updateMany instead.

DeviaVir commented 3 years ago

Dupe of https://github.com/DeviaVir/zenbot/issues/2234 ?

reynard80 commented 3 years ago

Yes, but that issue isn't about this message despite the title.

mmdiego commented 3 years ago

Duplicate of #1988 and is already fixed.

grainz commented 3 years ago

Duplicate of #1988 and is already fixed.

the error above is not corrected in the fix you tagged.

mmdiego commented 3 years ago

I don't see any bug described here. It only mentions a Warning message that appears somewhere. It doesn't give any kind of details and it's the same message fixed in #1988. @grainz What are you talking about?

grainz commented 3 years ago

I meant to say the warning, not an error, posted above was not included in the ticket you tagged. They are the same type of warnings that were fixed but the one posted above is not fixed. What are you talking about @mmdiego ? You say this is a duplicate but it is not.

Pistol-Peet commented 3 years ago

I do receive these warnings as well. Not sure about the exact impact yet. @james-ingold stated his fix "Replaces deprecated save calls in mongodb with replaceOne and insertOne." and it was merged into unstable end of Feb 2020. Unfortunately I do receive the warning still... image Version details: nodejs/unknown,now 14.16.0-deb-1nodesource1 amd64 mongodb/focal,now 1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu5 amd64 Ubuntu 20.04

Despite the mentioned versions on the documentaries, is there a up-to-date recommendation?

mmdiego commented 3 years ago

There is stilll one call to save() in trade.js that wasn't changed in the previous fix, that's why the message is still appearing. However, it won't affect functionality until it become obsolete. I'll fix it soon if I have some time.