Reputation: 1472
I am using Azure DocumentDB NoSQL database with an ASP.NET MVC front end.
I have a Families collection (just as an example):
[
{
"FamilyName": "Smith",
"Children": [
{
"FirstName": "John"
},
{
"FirstName": "Mike"
}
]
},
{
"FamilyName": "Williams",
"Children": [
{
"FirstName": "Mark"
},
{
"FirstName": "Mark"
},
{
"FirstName": "Peter"
}
]
}
]
Is there a way that I can retrieve a list of "Children" (e.g. List) in alpha order without looping through each family and building a separate list?
Upvotes: 0
Views: 431
Reputation: 35154
That's what JOIN
is used for:
SELECT c.FirstName
FROM Families f
JOIN c IN f.children
ORDER BY c.FirstName ASC
Upvotes: 1