I have got this document in myDb.myCollection
:
"_id" : ObjectId("55fc0ec8666292b85178c180"),
"firstname" : "george",
"surname" : "abitbol",
"data" : {
"a" : "secret value",
"b" : "4"
},
"tags" : "[t]"
How do I query for the b
field in data
to equal "4"
?
I tried this:
val r = myCollection.find({"data.b" -> "4"})
for (d <- r)
println (d)
But here is the error I get:
No implicit view available from (String, String) => com.mongodb.casbah.commons.TypeImports.DBObject.