I need to write a filter function that will allow me to query by nested object, like this:
var data = [
{ twitter: { id: 1, name: "Bob" } },
{ twitter: { id: 2, name: "Jones" } }
],
query = { 'twitter.id': 1 };
# Perform filter using data and query variables
var search = …
console.log(search);
> ["0"]
The filter should return an array of indexes that match the query.
I currently have this working without nested object support at http://jsbin.com/umeros/2/edit.
However, I would like to be able to query for nested objects, such as the query
seen above.