How to query in DocumentDB based on inner json object value? How to query in DocumentDB based on inner json object value? json json

How to query in DocumentDB based on inner json object value?


You can use DocumentDB's JOIN to create a cross product on documents with array elements.

For example, the following query creates a cross-product on documents with it's students property to query on the students.name:

select doc.idfrom docjoin students in doc.studentswhere students.name = 'sunny'

returns the following dataset:

[{    id: 111}, {    id: 222}]

Reference: http://azure.microsoft.com/en-us/documentation/articles/documentdb-sql-query/#joins