Using the WHERE clause
Filtering can be done by using the WHERE
clause. The conditions we add in the clause will cause DocumentDB to filter the collection, and any document must evaluate the specified conditions to be true, otherwise they will not be part of the result set. To demonstrate several operators in the WHERE
clause, our current PersonInformation
document will be expanded with several properties. The support C# solution from Chapter 3, Basic Querying, will be upgraded with this new requirement:
Every document will contain an indicator on how many devices this specific person has at home to support home automation
An additional subtree containing the actual home automation devices including the price of the device will be added
This section will demonstrate multiple operators for the WHERE
clause:
Binary operators
The
BETWEEN
keywordLogical operators
The
IN
keywordConditional expressions
Binary operators
Currently, DocumentDB supports the following binary operators:
Arithmetic |
|