I have an object model that looks like this:
"presentation": [
"categories: [
{ "slug": "my-slug"},
{ "slug": "my-slug-2"}
]
]
I can do this in Casbah and get a result:
val coll = MongoClient()("mydb")("presentations")
coll.find("categories" $elemMatch MongoDBObject("slug" -> "my-slug")).count
I am trying to accomplish the same thing in SalatDAO with a projection on the Category case class. I've tried a million different ways, and none have worked. One of them is this:
projection[Category]("categories" $elemMatch MongoDBObject("slug" -> "category-1-1234"), "categories")
Can anyone give me the right way to do this?
Thanks.