checkiz / elixir-mongo

MongoDB driver for Elixir
MIT License
101 stars 31 forks source link

How to provide authentication credentials #8

Closed trenpixster closed 9 years ago

trenpixster commented 10 years ago

Is there any way to provide the username and password for connecting to a MongoDB instance?

trenpixster commented 9 years ago

Nevermind, somehow I missed both the docs on auth and the last sample at the README.md. To whomever bumps into this, the steps are something along these lines:

db = Mongo.connect!("host", port).db("database_name").auth!("username", "password")