checkiz / elixir-mongo

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

key :count not found #17

Closed sclearion closed 8 years ago

sclearion commented 9 years ago

'coll.count' is returning a "key :count not found in %Mongo.Collection..." error. The block that throws this error looks like:?

coll = Mongo.connect! |> Mongo.db("clearion_api_dev") |> Mongo.Db.collection("users") coll.count

Am i doing something wrong?

jerp commented 8 years ago

please try

iex> collection = Mongo.Helpers.test_collection("anycoll")
      ...> {:ok, 6} = collection |> Mongo.Collection.count
      ...> 6 === collection |> Mongo.Collection.count!
      true