DocumentDB SQL Where Clause - DocumentDB SQL

What is Where Clause in DocumentDB SQL?

  • The WHERE clause is an optional used to specify a condition while fetching the data in the form of JSON documents provided by the source.
  • The JSON document should evaluate the specified conditions to be "true" to be considered for the result.
  • If the given condition is satisfied, only then it returns specific data in the form of JSON document(s).
  • WHERE clause can also be used to filter the records and fetch only necessary records.


Consider the same three documents.
The below code is the AndersenFamily document.

The below code is the SmithFamily document.

The below code is the WakefieldFamily document.

Consider an example in which WHERE clause is used.

where clause

From the above figure you can see that, in WHERE clause, the (WHERE = "WakefieldFamily") condition is specified.

On executing the above query, it will return the complete JSON document for WakefieldFamily as shown in the following output.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd Protection Status

DocumentDB SQL Topics