reactivemongo / reactivemongo-bson

:leaves: (Future) BSON library for ReactiveMongo

Website GitHub

ReactiveMongo Biːsən

BSON libraries for ReactiveMongo

Motivation

These libraries are intended to replace (at some point after release 1.0) the BSON library currently shipped along with ReactiveMongo driver.

It will fix some issues, bring multiple API and performance improvements (simpler & better).

TODO: Details & publish benchmarks

Usage

The main API library migrates both the BSON values types (with same names; see example) and the handler typeclasses (reader/writer; see example).

Note: The package of the new library is reactivemongo.api.bson (instead of reactivemongo.bson).

It can already be used in your build.sbt:

libraryDependencies += "org.reactivemongo" %% "reactivemongo-bson-api" % VERSION)

Maven Javadocs

import reactivemongo.api.bson._

This refactoring also includes the following optional libraries.

compat:

The compatibility library, that provides conversions between the current and the future APIs. It can be configured in the build.sbt as below.

libraryDependencies += "org.reactivemongo" %% "reactivemongo-bson-compat" % VERSION

Then the conversions can be imported:

import reactivemongo.api.bson.compat._

collection:

The library providing collection references, with operations using the BSON values from the new API.

msb-compat:

The compatiblity library for org.bson, that provides conversions between this package and the future BSON API. It can be configured in the build.sbt as below.

libraryDependencies += "org.reactivemongo" %% "reactivemongo-bson-msb-compat" % VERSION

Then the conversions can be imported:

import reactivemongo.api.bson.msb._

geo:

The GeoJSON library, that provides the geometry types and the handlers to read from and write to appropriate BSON representation.

It can be configured in the build.sbt as below.

libraryDependencies += "org.reactivemongo" %% "reactivemongo-bson-geo" % VERSION

monocle: EXPERIMENTAL

The library that provides Monocle utilities for BSON values. It can be configured in the build.sbt as below.

libraryDependencies += "org.reactivemongo" %% "reactivemongo-bson-monocle" % VERSION

Then the utilities can be imported:

import reactivemongo.api.bson.monocle._

Build manually

ReactiveMongo BSON libraries can be built from this source repository.

sbt publishLocal

To run the tests, use:

sbt test

Integration tests in the collection module requires a local MongoDB instance on port 27017 .

Travis: Travis build status