libbson bindings for The Julia Language
This software is licensed under the simplified BSD license; see the file LICENSE.md for details.
using LibBSON
bsonObject = BSONObject(Dict(
"null" => nothing,
"bool" => true,
"int" => 42,
"double" => 3.141,
"string" => "Hello, Jérôme",
"oid" => BSONOID(),
"minkey" => :minkey,
"maxkey" => :maxkey,
"binaryData" => Array{UInt8}(20),
"array" => Any[5.41, false]
))
println(bsonObject)
println(bsonObject["string"])
for (k, v) in bsonObject
println("$k => $v")
end
bsonArray = BSONArray(Any[
"one",
Dict("key" => 6.7)
])
for e in bsonArray
println(e)
end
Please refer to the unit tests in test/runtests.jl for more examples of usage.
Contributions are welcome! Please fork on github.com and submit a pull request if you have a contribution you think is worthwhile!