You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to self-host this bot (by building the docker image), I came across an issue where the bot threw out errors about TypeError: 'Collection' object is not callable. If you meant to call the 'update' method on a 'Collection' object it is failing because no such method exists., and I was not seeing any data written to the database.
Hosting
I'm running monogdb with the latest docker image (id: 20106db9aa7a) and connecting the two containers via a shared docker network.
A possible...solution?
From what I understand from the interwebs, this is due to pymongo changing the syntax for updating a collection to use .update_one() or .update_many() from v3.x onwards. (or at least what I think this is what the issue was)
Running the bot with pymongo 2.9.5 (the last version before pymongo 3.0) clears up the issues that I was facing. (changing requirements.txt:2 to pymongo==2.9.5)
(not to say we should be running a library that was built in 2015, but this seemed like the easiest method to get the bot up and running without any code changes so ¯\_(ツ)_/¯ )
alternatively, if there are plans to update the bot, then the above can probably be ignored lol
The text was updated successfully, but these errors were encountered:
Thanks for the insight, I was not aware of this! Since the goal is eventually to re-write the bot with slash commands this will get lumped in with that when I get the time :')
The Issue
When attempting to self-host this bot (by building the docker image), I came across an issue where the bot threw out errors about
TypeError: 'Collection' object is not callable. If you meant to call the 'update' method on a 'Collection' object it is failing because no such method exists.
, and I was not seeing any data written to the database.Hosting
I'm running monogdb with the latest docker image (id: 20106db9aa7a) and connecting the two containers via a shared docker network.
A possible...solution?
From what I understand from the interwebs, this is due to pymongo changing the syntax for updating a collection to use
.update_one()
or.update_many()
from v3.x onwards. (or at least what I think this is what the issue was)Running the bot with pymongo 2.9.5 (the last version before pymongo 3.0) clears up the issues that I was facing. (changing
requirements.txt:2
topymongo==2.9.5
)(not to say we should be running a library that was built in 2015, but this seemed like the easiest method to get the bot up and running without any code changes so ¯\_(ツ)_/¯ )
alternatively, if there are plans to update the bot, then the above can probably be ignored lolThe text was updated successfully, but these errors were encountered: