I'm trying to setup a chatterbot with MongoDB, and I'm having issues authenticating with my bot script. Basically, I don't know if the MongoDatabaseAdapter object allows for authentication. Here's my code:
# Create a new ChatBot instance
bot = ChatBot('Terminal',
storage_adapter='chatterbot.storage.MongoDatabaseAdapter',
logic_adapters=[
'chatterbot.logic.BestMatch'
],
filters=[
'chatterbot.filters.RepetitiveResponseFilter'
],
input_adapter='chatterbot.input.TerminalAdapter',
output_adapter='chatterbot.output.TerminalAdapter',
database='ava_database',
database_uri='127.0.0.1:27017'
)
The code worked when I first installed Mongo DB, but I wanted to protect the database a bit, so I created a user/pass combo to use with the project. Unfortunately, I don't know how to create a chatbot instance using my user/pass combo.
Has anyone ran into this issue using MongoDB? Did you create your own object, or is there a parameter that I'm missing somewhere.
Try like this
# Create a new ChatBot instance
bot = ChatBot('Terminal',
storage_adapter='chatterbot.storage.MongoDatabaseAdapter',
logic_adapters=[
'chatterbot.logic.BestMatch'
],
filters=[
'chatterbot.filters.RepetitiveResponseFilter'
],
input_adapter='chatterbot.input.TerminalAdapter',
output_adapter='chatterbot.output.TerminalAdapter',
database='ava_database',
database_uri='mongodb://user:password@server:port/''
)
More information available here https://docs.mongodb.com/manual/reference/connection-string/
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Try like this
More information available here https://docs.mongodb.com/manual/reference/connection-string/