BSON libraries for ReactiveMongo
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
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 ofreactivemongo.bson
).
It can already be used in your build.sbt
:
libraryDependencies += "org.reactivemongo" %% "reactivemongo-bson-api" % VERSION)
import reactivemongo.api.bson._
This refactoring also includes the following optional libraries.
compat:
The compatibility library, that provides conversions between the previous and the new 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._
msb-compat:
The compatiblity library for org.bson
, that provides conversions between this package and the new 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._
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 .