How to convert JSON String to a BSONDocument
问题 I have the following function that uses the reactivemongo driver and actually does a good job writing to the database. def writeDocument() = { val document = BSONDocument( "firstName" -> "Stephane", "lastName" -> "Godbillon", "age" -> 29) val future = collection.insert(document) future.onComplete { case Failure(e) => throw e case Success(result) => { println("successfully inserted document with result = " + result) } } } But the limitation of that function is that the JSON is hardcoded into a