feedhenry / fh-db

Apache License 2.0
1 stars 16 forks source link

🐛 RHMAP-16889 Allow mongodb connection string to work without auth #31

Closed david-martin closed 7 years ago

david-martin commented 7 years ago

This addresses the following error when using fh-db (via fh-mbaas-api) for local development i.e. when FH_USE_LOCAL_DB is true:

    LOCALDB error Error: Incorrect format for database connection string.

The actual error & stack is captured here. https://gist.github.com/david-martin/eb96556f07ef05d8441238e70983d197 The mongo string parsing function is making the assumption that there is an @ symbol i.e. a user & password is specified before the mongodb host.

The fix checks for the existense of the @ symbol before tyring to split the string and use parts of it

psturc commented 7 years ago

Fixed by using auth (user:pass) in testing-cloud-app https://github.com/feedhenry/testing-cloud-app/pull/28. Closing this PR