假设我有一个JsValue
.
val dbo = MongoDBObject("id" -> "0001", "name" -> "Kevin", "age" -> "100")
val json: JsValue = Json.parse(dbo.toString)
我试图通过json
插入:
val obj = MongoDBObject("key" -> json)
collection.insert(obj)
但是,当我从 Mongo shell 中执行时,有很多括号[
并]
添加到该部分。json
db.collection.findOne()
如何在 Casbah 中正确地将 JsValue 添加到 Mongo 中?