Frage

I'm trying to convert a parsed JSON document in a lift-json's JValue into a Casbah MongoDBObject - is there a way to do this?

War es hilfreich?

Lösung

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

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

Andere Tipps

Then there is also the net.liftweb.mongodb.JObjectParser with its parse method. The Casbah implicit will convert DBObject into MongoDBObject.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top