Skip to content

Fixed the connection string for master/slave set up #17

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 3 commits into from

Conversation

agdm
Copy link

@agdm agdm commented Aug 7, 2013

The previous version was adding the user:password twice in the connection string resulting in an error. ✌️

@jenssegers
Copy link
Contributor

This pull request breaks the code if there are no credentials. Are you sure you only need to add credentials once for multiple hosts?

@agdm
Copy link
Author

agdm commented Aug 7, 2013

Added a default value, would this work?

I assumed that user:pass credentials would always be required.

agdm@94364f4#L0L113

@jenssegers
Copy link
Contributor

Can you confirm that the correct DSN is mongodb://username:password@10.0.0.1,10.0.0.2 and not mongodb://username:password@10.0.0.1,username:password@10.0.0.2?

@jenssegers jenssegers closed this in f575d18 Aug 7, 2013
@agdm
Copy link
Author

agdm commented Aug 7, 2013

Yes I have confirmed it, I use mongolab.com for my remote mongo host.

In order to connect to their master/slave set up the connection string is provided in mongodb://username:password@10.0.0.1:port,10.0.0.2:port format.

Also when testing the site I'm building currently with Laravel, the DSN was erroring out and as soon as I updated the logic, it worked.

So my thoughts are that the user/pass only need to be specified once in the master/slave set up.

alcaeus pushed a commit to alcaeus/laravel-mongodb that referenced this pull request Aug 16, 2023
- Fix support for % and _ in like expression and escaped \% and \_
- Keep ilike and regexp operators as aliases for like and regex
- Allow /, # and ~ as regex delimiters
- Add functional tests on regexp and not regexp
- Add support for not regex
alcaeus pushed a commit that referenced this pull request Aug 22, 2023
- Fix support for % and _ in like expression and escaped \% and \_
- Keep ilike and regexp operators as aliases for like and regex
- Allow /, # and ~ as regex delimiters
- Add functional tests on regexp and not regexp
- Add support for not regex
mnphpexpert added a commit to mnphpexpert/laravel-mongodb that referenced this pull request Sep 2, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants