Open tastywheat opened 8 years ago
please try
Mongo.connect! |> Mongo.db("test") |> Mongo.Db.collection("articles") |> Mongo.Collection.find |> Enum.to_list
I'm doing this:
articles
|> Mongo.Collection.find
|> Mongo.Find.exec
|> Enum.to_list
|> IO.inspect
Then getting back a binary response:
[%Mongo.Response{buffer: <<216, 5, 0, 0, 2, 95, 105, 100, 0, 10, 0, 0, 0, 120, 118, 90, 99, 114, 108, 70, 87, 121, 0, 2, 115, 111, 117, 114, 99, 101, 65, 114, 116, 105, 99, 108, 101, 85, 114, 108, 0, 114, 0, 0, 0, 104, 116, 116, ...>>,
cursorID: 8803432542, decoder: &Mongo.Response.bson_decode/1, nbdoc: 101,
requestID: 1303776868, startingFrom: 0},
%Mongo.Response{buffer: <<36, 21, 0, 0, 2, 95, 105, 100, 0, 10, 0, 0, 0, 118, 111, 68, 116, 88, 78, 83, 65, 109, 0, 2, 115, 111, 117, 114, 99, 101, 83, 105, 116, 101, 0, 20, 0, 0, 0, 119, 119, 119, 46, 97, 115, 105, 97, 110, ...>>,
cursorID: 0, decoder: &Mongo.Response.bson_decode/1, nbdoc: 272,
requestID: 1199601926, startingFrom: 101}]
What am I supposed to do with this?
Please try the following
Mongo.connect! |> Mongo.db("test") |> Mongo.Db.collection("anycoll") |> Mongo.Collection.find |> Enum.to_list
On 16 Dec 2015, at 01:24, tastywheat <notifications@github.com mailto:notifications@github.com> wrote:
I'm doing this:
articles |> Mongo.Collection.find |> Mongo.Find.exec |> Enum.to_list |> IO.inspect
Then getting back a binary response:
[%Mongo.Response{buffer: <<216, 5, 0, 0, 2, 95, 105, 100, 0, 10, 0, 0, 0, 120, 118, 90, 99, 114, 108, 70, 87, 121, 0, 2, 115, 111, 117, 114, 99, 101, 65, 114, 116, 105, 99, 108, 101, 85, 114, 108, 0, 114, 0, 0, 0, 104, 116, 116, ...>>, cursorID: 8803432542, decoder: &Mongo.Response.bson_decode/1, nbdoc: 101, requestID: 1303776868, startingFrom: 0}, %Mongo.Response{buffer: <<36, 21, 0, 0, 2, 95, 105, 100, 0, 10, 0, 0, 0, 118, 111, 68, 116, 88, 78, 83, 65, 109, 0, 2, 115, 111, 117, 114, 99, 101, 83, 105, 116, 101, 0, 20, 0, 0, 0, 119, 119, 119, 46, 97, 115, 105, 97, 110, ...>>, cursorID: 0, decoder: &Mongo.Response.bson_decode/1, nbdoc: 272, requestID: 1199601926, startingFrom: 101}] What am I supposed to do with this?
— Reply to this email directly or view it on GitHub https://github.com/checkiz/elixir-mongo/issues/30#issuecomment-164942557.
Being new to both Mongo and Elixir, I too could use a little documentation of some sort. Perhaps add examples to the API docs at http://checkiz.github.io/elixir-mongo/
I can't seem to find any documentation which explains how to decode a list of
find
results. So far I have a list ofMongo.Response
, but I have no idea where to go from here: