Convert JValue elevator json to MongoDBObject using Casbah?

I am trying to convert a parsed JSON document to lifting json JValue in Casbah MongoDBObject - is there any way to do this?

+5
source share
2 answers

You can convert lift-json to Map [String, Any], and then use the implicit asDBObject method on Map:

val record = record.values.asInstanceOf[Map[String, Any]]
record.asDBObject
+3
source

Then eat net.liftweb.mongodb.JObjectParserusing the method parse. Kabba implicitly converts DBObjectto MongoDBObject.

+2
source

All Articles