harksin harksin - 2 months ago 24
Scala Question

BSONDocument from JSON string

Anyone know how convert a json string in

BSONDocument
with ReactiveMongo driver ?

It looks like apply function for
jsonString
who existing in the official Mongo Scala driver is not existing for now with reactive Driver.

Answer

It doesn't really make sense to convert a JSON String to a BSONDocument. If working with JSON, the JSON pack is recommanded, which leads to be able to convert any JsValue to a BSONValue.