A MongoDB driver in Elixir.
API entirely reviewed, see CHANGELOG.md
Example preparing access to the anycoll
collection in the test
db :
# Connect the mongo server (by default port 27017 at 127.0.0.1)
mongo = Mongo.connect!
# Select the db to access
db = mongo |> Mongo.db("test")
# Select the db to access
anycoll = db |> Mongo.Db.collection("anycoll")
Examples accessing the anycoll
collection via CRUD operations see Mongo.Find
Example of aggregate operation applied to the anycoll
collection see Mongo.Collection
# Authenticate against the db
db |> Mongo.auth("testuser", "123")`
# Retrieve the last error
db |> Mongo.getLastError
- MongoDB needs a Bson encoder/decoder, this project uses the elixir-bson encoder/decoder. See elixir-bson source repo and its documentation