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

Mango DB #24

Closed
bitog opened this issue Jun 11, 2020 · 3 comments
Closed

Mango DB #24

bitog opened this issue Jun 11, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@bitog
Copy link

bitog commented Jun 11, 2020

Hi there,

Thanks for your userbot. I am currently having a few issues with Mango DB. I am unsure how to connect using the Mango DB Atlas. I do have a cluster but all I get is a connection URL rather than what you show in your config file:
[mongo] url = localhost db_name = userbot db_username = db_password =

Id appreciate it if you could help me out where I can find those.

Thank you!

@athphane
Copy link
Owner

Hi. Thanks for the issue. I just pushed a small change that will allow for better support of Mongo Atlas connection URL..

Your connection string should look something like this.
mongodb+srv://<usrename>:<password>@something.mongodb.net/<dbname>?retryWrites=true&w=majority

I added an extra field into the [mongo] section in the userbot.ini file called is_atlas. This defaults to false. So you just have to add it to you .ini file and set it to True. Look at userbot.ini.sample for more info.

[mongo]
url = atlas_connection_string
db_name = userbot_or_something

If you have special characters in your password, please URL encode it.

Whatever <dbname> you decide to use in your connection string, the bot still needs the db_name value in the userbot.ini file. I suggest you use the same name in the connection string and in the db_name field.

Also you can simply leave db_username and db_password blank as they are not required if you are using Mongo Atlas.

Please use the updated code and try again. Comment back if you have any more questions.

@bitog
Copy link
Author

bitog commented Jun 11, 2020

Awesome, thanks a lot for the fix. That did solve my issue.

I was wondering are you planning on adding pmpermit back? Since I usually enjoy that a lot.

@athphane
Copy link
Owner

@dducted Yes i do plan on bringing it back. Just that there are a lot of different cases i need to think of before releasing it to the master branch.

@phoenixatom phoenixatom added the bug Something isn't working label Jun 11, 2020
Repository owner locked as resolved and limited conversation to collaborators Jun 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants