documentcloud/underscore — pull request #949 by gsamokovarov (2013-01-22 18:56:11+00:00)
Title: Add deep comparison support for _.where

Sometimes I have nested resources in my API responses and I often find myself trying to search with a whole embedded resource. For example, take an response similar to this:

```javascript
[
{"id": 1, "rel": {"id": 1}},
{"id": 2, "rel": {"id": 2}},
{"id": 3, "rel": {"id": 1}}
]
```

I would often do `_.where(response, {rel: {id: 1}})`. Maybe someone else has similar use-cases and would like to use it that way too.

This, however, has the drawback of slowing `_.where` down. jsPerf doesn't load for me at the moment, when it does I will post one showing the speed diff for searching just plain values.