I made a discord bot in python , now I am trying save my data on database instead of local files. I am trying to use insert_one in database but it show error . Its very basic code but dont know why this problem apper while all you tube , tutorial said its ok. My code is:
• Add triple backticks (```) before and after a snippet of code. This syntax (aka code fencing in GItHub-flavoured Markdown) will automatically detect language formatting 1 and generally be an improvement over a straight copy & paste.
• Log lines can be formatted better by prefixing with > (aka quoting). This will wrap long lines and provide some visual distinction from code blocks. The editing toolbar has a shortcut for toggling line quoting on the currently selected text: ” . You can also use the (```) formatting for log snippets, but quoting generally works better.
• Add spacing to break up long blocks of text and improve readability
Thanks for you reply. It creates CommandInvokeError.
Also when I use command “find_one” it works nice when data available but when data not available in collection ( I mean different data is available not not matched with find_one) then it creates CommandInvokeError.
at present when I use count() function to count document in any collection then it works fine but showing message to use count_documents function but when I use count_documents instead of couny() it raise error… perhaps I dont know exact syntax of count_documants
If you want us to help you with that you will have to share the code so that we see how you use it. It will also be very helpful to see the exact error that is raised.
While I await for your feedback on the compatibility issue you found, I went and look at the documentation I posted. It seems that you simply need to pass the empty query {} as the parameter to count_document() since this API does not have a default parameter. So now I
I found this problem was very general and found solution when google.
At present my bot is running perfectly with MongoDb Atlas but when I connect it to repl.it to make it online 24/7 it connect but does not read data from MongoDb . I google but everywhere same process is explained which i did. links cant be wrong as it connect and work when i run it without repl.it. I used free version of MongoDb , since my data are in kbs and I have allowed upto 512MB hence it should work. Any idea how to resolve this issue?