# \[ANN\] Mongoc.jl v0.1.0 - a MongoDB driver for Julia

**URL:** <https://discourse.julialang.org/t/ann-mongoc-jl-v0-1-0-a-mongodb-driver-for-julia/15308>\
**Category:** Community\
**Tags:** package\
**Created:** [September 21, 2018, 7:29pm UTC](https://discourse.julialang.org/t/ann-mongoc-jl-v0-1-0-a-mongodb-driver-for-julia/15308 "2018-09-21T19:29:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![felipenoris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/felipenoris/32/553_2.png) [@felipenoris](https://discourse.julialang.org/u/felipenoris)\
**Post date:** [September 21, 2018, 7:29pm UTC](https://discourse.julialang.org/t/ann-mongoc-jl-v0-1-0-a-mongodb-driver-for-julia/15308/1 "2018-09-21T19:29:45Z")

</div>

[GitHub - felipenoris/Mongoc.jl: MongoDB driver for the Julia Language](https://github.com/felipenoris/Mongoc.jl) is a MongoDB driver for Julia.

It supports recent MongoDB features, like Sessions and Transactions. And also authentication, aggregation, map-reduce and BSON parsing.

There’s a comprehensive documentation at [Home · Mongoc.jl](https://felipenoris.github.io/Mongoc.jl/latest/) .

It’s a sweet package, in the sense that it is loaded with some syntactic sugar. As an example, this is how you would make a transaction:

```julia
import Mongoc

# connect to a Replica Set
client = Mongoc.Client("mongodb://127.0.0.1:27021,127.0.0.1:27022,127.0.0.1:27023/?replicaSet=rs0")

Mongoc.transaction(client) do session
    database = session["my_database"]
    collection = database["my_collection"]
    new_item = Mongoc.BSON()
    new_item["inserted"] = true
    push!(collection, new_item)
end

```

In PyMongo, for a comparison, you would have to manually link database operations to the session.

I would also like to point out the difference between this package and **LibBSON.jl/Mongo.jl** , which I also have contributed recently : **Mongoc.jl** links to the new mongoc library, while **LibBSON.jl** and **Mongo.jl** uses an old C driver. So an update would make a lot of breaking changes, and this is why I tried to code **Mongoc.jl** from scratch.

For those of you who would like to contribute, please help me find possible memory leaks.

Enjoy!

---

<div class="post-metadata">

**Author:** ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Post date:** [September 22, 2018, 1:52am UTC](https://discourse.julialang.org/t/ann-mongoc-jl-v0-1-0-a-mongodb-driver-for-julia/15308/2 "2018-09-22T01:52:14Z")

</div>

This is awesome!!
