문제

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?

도움이 되었습니까?

해결책

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

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top