davidgtonge/backbone_query — Issue #4: Search on nested properties
Author: brasic
Created: 2012-02-28 17:46:10+00:00
State: open

Given a collection consisting of models like

```json
{
"title": "post title",
"content": "post content",
"id": "1",
"comments": [
{
"text": "comment 1 content"
},
{
"text": "comment 2 content"
}
]
}
```

I'd like to be able to query against the text inside the nested array, in addition to the text in the toplevel attributes. Currently I'm doing this server-side using a mongo query against the nested property like:

```ruby

find(
"$or"=>[
{:title => /#{query}/i},
{:content => /#{query}/i},
{"comments.text" => /#{query}/i}
]
)
```

Is it possible or planned to approximate this behavior with backbone_query?