Skip to content

Please add useful documentation #30

@tastywheat

Description

@tastywheat

I can't seem to find any documentation which explains how to decode a list of find results. So far I have a list of Mongo.Response, but I have no idea where to go from here:

# 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
        articles = db |> Mongo.Db.collection("articles")

        articles
            |> Mongo.Collection.find
            # |> Map.put(:batchSize, 4)
            |> Mongo.Find.exec
            |> Enum.to_list
            |> Enum.map fn doc -> Mongo.Response.bson_decode(doc.buffer) end
            |> IO.inspect

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions