Skip to content

Instantly share code, notes, and snippets.

@peterzawistowicz
Created September 24, 2015 13:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterzawistowicz/0d3189602d6eb337d72d to your computer and use it in GitHub Desktop.
Save peterzawistowicz/0d3189602d6eb337d72d to your computer and use it in GitHub Desktop.
# WRONG WAY IS FATAL
$client = MongoDB->connect()
$client->authenticate("foo", "username", "sekret");
# RIGHT WAY
$client = MongoDB->connect("mongodb://username:sekret@localhost/foo");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment