DocumentDB SQL In Keyword - DocumentDB SQL

What is In Keyword in DocumentDB SQL?

  • The IN keyword is used to check whether a specified value matches any value in a list.
  • This operators allows you to specify multiple values in a WHERE clause. IN is equivalent to chaining multiple OR clauses.

Consider the three documents as done in previous example.

The below code is the AndersenFamily document.

The below code is the SmithFamily document.

The below code is the WakefieldFamily document.

Consider a simple example.

in keyword

The below query will retrieve the data whose familyName is either “Smith” or Wakefield.

On executing the above code the following result is produced:

Consider another example in which all family documents will be retrieved where the id is one of "SmithFamily" or "AndersenFamily". Following is the query.

On executing the above code the following result is produced:

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

DocumentDB SQL Topics