DocumentDB SQL Array Creation - DocumentDB SQL

What is Array Creation in DocumentDB SQL?

In DocumentDB SQL , Microsoft has added a key feature which helps to create an array.
When a query is run, it will create an array of collection similar to JSON object as a result of query.

Following is the AndersenFamily document.

Following is the SmithFamily document.

Following is the WakefieldFamily document.

Let’s take a look at an example.

array creation

Following is the query which will return the family name and address of each family.

As can be seen city, county and state fields are enclosed in square brackets, which will create an array and this array is named Address. When the above query is executed, it produces the following output.

The city, county, and state information are added in the Address array in the above output.

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

DocumentDB SQL Topics