Lytol / Mongo.jl

Mongo bindings for the Julia programming language
MIT License
30 stars 37 forks source link

Getting Started Error #30

Open marcstein opened 9 years ago

marcstein commented 9 years ago

When I attempt to run

require("Mongo.jl") using Mongo client = MongoClient() # Defaults to MongoClient("localhost", 27017) insert(client, "test.people", { "name" => "Brian", "age" => 30, "hobbies" => {"surfing", "coding", "video games"}})

I get the following error

ERROR: insert has no method matching insert(::MongoClient, ::ASCIIString, ::Dict{Any,Any})

client has been initialized.

I've tried this under v3 and v4. What am I doing wrong?

Thanks in advance!

szalmaf commented 8 years ago

Probably it is a late answer, but did you try something like:

using Mongo
client = MongoClient() # Defaults to MongoClient("localhost", 27017)
colln = MongoCollection(client, "test", "people")
insert(colln, { "name" => "Brian", "age" => 30, "hobbies" => {"surfing", "coding", "video games"}})