I have a document with this structure:
[{
"id": "test",
"StudentRules": [
{
"id": "d8b730905",
"name": "Test",
"ruletype": "Allow",
"startdate": "5/7/2015 10:05:15 AM"
}
]
I need to write a query that will give me all the "StudentRules" for a given id "test".
I wrote this:
select * from json j where j.id = "test"
This returns the structure as the example above. I am expecting this:
[
{
"id": "d8b730905",
"name": "Test",
"ruletype": "Allow",
"startdate": "5/7/2015 10:05:15 AM"
}
]
The idea is to have all the rules in a list which will be shown in an MVC application.
Any help is greatly appreciated.
Thanks in advance.
Regards.