0

Let's say I have a JsValue.

val dbo = MongoDBObject("id" -> "0001", "name" -> "Kevin", "age" -> "100") 
val json: JsValue = Json.parse(dbo.toString)

I tried to insert json via:

val obj = MongoDBObject("key" -> json)
collection.insert(obj)

However, there are many brackets [ and ] added to the json part when I do a db.collection.findOne() from the Mongo shell.

How can I properly add a JsValue into Mongo in Casbah?

Community
  • 1
  • 1
Kevin Meredith
  • 41,036
  • 63
  • 209
  • 384

0 Answers0