Are there specific js libraries or techniques for querying json objects in the browser - i.e. 'get all People where person.name = "Joe"'. Something similar to what linq does in .NET.....
2 Answers
You may take a look at LINQ to Javascript. There are also many others, just pick one that fits your needs.
3 Comments
Sky Sanders
i love jslinq. except when i hate it for breaking at the most inconvenient time. there is another less featured library, linqjs, up there on codeplex that is cool too. But jslinq has grouping which is just too cool.
Sky Sanders
myJoes = Enumerable.From({object or array }).Where("$.name=='Joe').ToArray();
mikeymo
Thanks. I had seen those and just wanted to get a sense for what people were actually using and happy with. I should have phrased the question in that manner :)
There are several options:
- jsonpath
- Dojo jsonquery
- There are several others listed at the bottom of the Wikipedia linq page.