checkiz / elixir-mongo

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

dropping the record hack that allows writing Mongo.connect!.db("test").collection("anycoll") #11

Closed jerp closed 10 years ago

jerp commented 10 years ago

A while back I submitted a question on the elixirllang-talk google group asking about the way I implemented this driver in Elixir.

https://groups.google.com/forum/#!topic/elixir-lang-talk/QKNM_NsIRGE

I'm about to implement what was recommended by José Valim, this is, write

coll = Mongo.connect! |> Mongo.db("test") |> Mongo.Db.collection("anycoll")

rather than

coll = Mongo.connect!.db("test").collection("anycoll")

This notation is a bit more verbose, less mongo but more Elixir

I believe it would also simplify the code

jerp commented 10 years ago

done in v0.5.0