Skip to content

Commit e160e4f

Browse files
authored
Merge branch 'MicrosoftDocs:main' into cosmos-nosql-query-geospatial
2 parents 3189e1f + 4ddb7c6 commit e160e4f

File tree

11 files changed

+432
-440
lines changed

11 files changed

+432
-440
lines changed

articles/communication-services/quickstarts/telephony/get-trial-phone-number.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ms.custom: template-quickstart
1414
[!INCLUDE [Public Preview Notice](../../includes/public-preview-include.md)]
1515

1616
> [!NOTE]
17-
> Trial Phone Numbers are currently only supported by Azure subscriptions with billing addresses based in the United States. To those outside the US, you can visit the [Subscription eligibility](../../concepts/numbers/sub-eligibility-number-capability.md) documentation to determine where you purchase a phone number.
17+
> Trial Phone Numbers are currently only supported by Azure subscriptions with billing addresses based in the United States. For other geographies, please visit the [Subscription eligibility](../../concepts/numbers/sub-eligibility-number-capability.md) documentation to determine where you can purchase a phone number.
1818
1919
Azure Communication Services provides powerful communication capabilities for developers to integrate voice, video, and SMS functionalities into their applications. One of the key features is the ability to acquire phone numbers for making and receiving calls. This quickstart guide walks you through the process of obtaining a trial phone number for Azure Communication Services.
2020

@@ -34,30 +34,30 @@ If you don’t have any phone numbers yet, you will see an empty list of phone n
3434
If you already have numbers for your Communication Services resource, you can also activate a trial phone number:
3535
:::image type="content" source="./media/trial-phone-numbers/trial-empty-with-purchased-numbers.png" alt-text="Screenshot showing a Communication Services resource's phone numbers page with already purchased numbers." lightbox="./media/trial-phone-numbers/trial-empty-with-purchased-numbers.png":::
3636

37-
3. Select on “Activate trial phone number”. This immediately provisions a trial phone number to your Communication Services resource. Once the trial phone number is provisioned, you can view it on the Phone numbers page.
37+
3. Select on “Activate trial phone number”. This immediately provisions a trial phone number to your Communication Services resource. Once the trial phone number is provisioned, you can view it on the Phone numbers page.
3838
:::image type="content" source="./media/trial-phone-numbers/trial-activated.png" alt-text="Screenshot showing a Communication Services resource's phone numbers page with a trial phone number." lightbox="./media/trial-phone-numbers/trial-activated.png":::
3939

4040
## Add a verified phone number to your trial phone number
41-
When using a trial phone number in Azure Communication Services for PSTN Calling capabilities, it is required to verify the recipient phone number. This verification process ensures that the trial phone number can only make calls to the verified number.
41+
When using a trial phone number in Azure Communication Services for PSTN Calling capabilities, it is mandatory to verify the recipient phone number. This verification process ensures that the trial phone number can only make calls to the verified number.
4242

43-
1. Once your trial phone number is provisioned, select on the number in the Phone Numbers page and navigate to the “Trial details” tab:
43+
1. Once your trial phone number is provisioned, select the number in the Phone Numbers page and navigate to the “Trial details” tab:
4444
:::image type="content" source="./media/trial-phone-numbers/trial-details.png" alt-text="Screenshot showing a Communication Services resource's phone numbers page with a side panel open with the trial details tab." lightbox="./media/trial-phone-numbers/trial-details.png":::
4545
This tab shows the current limitations on the number, including the days left to use the number, the total calling minutes, and how many verified phone numbers are attached to the trial phone number. You can find more information on the trial phone number limitations [here](../../concepts/telephony/trial-phone-numbers-faq.md).
4646

4747
2. Select on “Manage verified phone numbers” to start adding verified phone numbers.
4848
:::image type="content" source="./media/trial-phone-numbers/verified-empty.png" alt-text="Screenshot showing a side panel with an empty list of verified phone numbers." lightbox="./media/trial-phone-numbers/verified-empty.png":::
4949

50-
3. Select “Add” or “Verify a phone number” and enter your phone number and designated country code associated with it. This recipient phone number is verified by sending a one-time passcode (OTP) to their number either through SMS or automated voicemail. Choose which option you prefer, and then press “Next” to receive the OTP.
50+
3. Select “Add” or “Verify a phone number” and enter your phone number and designated country code associated with it. This recipient phone number is verified by sending a one-time passcode (OTP) to their number either through SMS or automated voicemail. Choose the option you prefer, and then press “Next” to receive the OTP.
5151
:::image type="content" source="./media/trial-phone-numbers/verified-enter-number.png" alt-text="Screenshot showing a side panel with an entered phone number to verify. The radio button to text the phone number has been selected." lightbox="./media/trial-phone-numbers/verified-enter-number.png":::
5252

5353
4. Once the user gets the one-time-passcode (OTP), enter the code into the Portal to verify the number.
5454
:::image type="content" source="./media/trial-phone-numbers/verified-text-code.png" alt-text="Screenshot showing a side panel with an entered one-time passcode." lightbox="./media/trial-phone-numbers/verified-text-code.png":::
5555

56-
5. Once the correct OTP is entered, the phone number is verified, and it shows in the list of verified numbers that the trial number can call.
56+
5. Once the correct OTP is entered, the phone number is verified, it should show up in the list of verified numbers that the trial number can call.
5757
:::image type="content" source="./media/trial-phone-numbers/verified-added.png" alt-text="Screenshot showing a side panel with an added verified phone number." lightbox="./media/trial-phone-numbers/verified-added.png":::
5858

5959
## Conclusion
60-
Congratulations! You have successfully obtained a trial phone number for Azure Communication Services. You can now use this phone number to add voice capabilities to your applications. Explore the documentation and resources provided by Microsoft to learn more about Azure Communication Services and integrate it into your projects.
60+
Congratulations! You have successfully obtained a trial phone number for Azure Communication Services. You can now use this phone number to add voice capabilities to your applications. Explore the documentation and resources provided by Microsoft to learn more about Azure Communication Services and integrate it into your solutions.
6161

6262
Remember that trial phone numbers have limitations and are intended for evaluation and development purposes. If you require production-ready phone numbers, you can upgrade your Azure Communication Services subscription and [purchase a phone number](get-phone-number.md).
6363

Lines changed: 71 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -1,207 +1,147 @@
11
---
2-
title: Working with arrays and objects in Azure Cosmos DB
3-
description: Learn the SQL syntax to create arrays and objects in Azure Cosmos DB. This article also provides some examples to perform operations on array objects
4-
author: seesharprun
2+
title: Working with arrays and objects
3+
titleSuffix: Azure Cosmos DB for NoSQL
4+
description: Create arrays and objects and perform actions on them using the array syntax in Azure Cosmos DB for NoSQL.
5+
author: jcodella
6+
ms.author: jacodel
7+
ms.reviewer: sidandrews
58
ms.service: cosmos-db
69
ms.subservice: nosql
7-
ms.custom: ignite-2022
8-
ms.topic: conceptual
9-
ms.date: 02/02/2021
10-
ms.author: sidandrews
11-
ms.reviewer: jucocchi
10+
ms.topic: reference
11+
ms.date: 07/31/2023
12+
ms.custom: query-reference
1213
---
13-
# Working with arrays and objects in Azure Cosmos DB
14-
[!INCLUDE[NoSQL](../../includes/appliesto-nosql.md)]
1514

16-
A key feature of the Azure Cosmos DB for NoSQL is array and object creation. This document uses examples that can be recreated using the [Family dataset](getting-started.md#upload-sample-data).
15+
# Working with arrays and objects in Azure Cosmos DB for NoSQL
16+
17+
[!INCLUDE[NoSQL](../../includes/appliesto-nosql.md)]
1718

18-
Here's an example item in this dataset:
19+
Here's an item that's used in examples throughout this article.
1920

2021
```json
2122
{
22-
"id": "AndersenFamily",
23-
"lastName": "Andersen",
24-
"parents": [
25-
{ "firstName": "Thomas" },
26-
{ "firstName": "Mary Kay"}
23+
"name": "Sondon Fins",
24+
"categories": [
25+
{ "name": "swim" },
26+
{ "name": "gear"}
2727
],
28-
"children": [
29-
{
30-
"firstName": "Henriette Thaulow",
31-
"gender": "female",
32-
"grade": 5,
33-
"pets": [{ "givenName": "Fluffy" }]
34-
}
35-
],
36-
"address": { "state": "WA", "county": "King", "city": "Seattle" },
37-
"creationDate": 1431620472,
38-
"isRegistered": true
28+
"metadata": {
29+
"sku": "73310",
30+
"manufacturer": "AdventureWorks"
31+
},
32+
"priceInUSD": 132.35,
33+
"priceInCAD": 174.50
3934
}
4035
```
4136

4237
## Arrays
4338

44-
You can construct arrays, as shown in the following example:
39+
You can construct arrays using static values, as shown in the following example.
4540

4641
```sql
47-
SELECT [f.address.city, f.address.state] AS CityState
48-
FROM Families f
42+
SELECT
43+
[p.priceInUSD, p.priceInCAD] AS priceData
44+
FROM products p
4945
```
5046

51-
The results are:
52-
5347
```json
5448
[
5549
{
56-
"CityState": [
57-
"Seattle",
58-
"WA"
59-
]
60-
},
61-
{
62-
"CityState": [
63-
"NY",
64-
"NY"
50+
"priceData": [
51+
132.35,
52+
174.5
6553
]
6654
}
6755
]
6856
```
6957

70-
You can also use the [ARRAY expression](subquery.md#array-expression) to construct an array from [subquery's](subquery.md) results. This query gets all the distinct given names of children in an array.
58+
You can also use the [``ARRAY`` expression](subquery.md#array-expression) to construct an array from a [subquery's](subquery.md) results. This query gets all the distinct categories.
7159

7260
```sql
73-
SELECT f.id, ARRAY(SELECT DISTINCT VALUE c.givenName FROM c IN f.children) as ChildNames
74-
FROM f
61+
SELECT
62+
p.id,
63+
ARRAY (SELECT DISTINCT VALUE c.name FROM c IN p.categories) AS categoryNames
64+
FROM
65+
products p
7566
```
7667

77-
The results are:
78-
7968
```json
8069
[
81-
{
82-
"id": "AndersenFamily",
83-
"ChildNames": []
84-
},
85-
{
86-
"id": "WakefieldFamily",
87-
"ChildNames": [
88-
"Jesse",
89-
"Lisa"
90-
]
91-
}
70+
{
71+
"id": "a0151c77-ffc3-4fa6-a495-7b53d936faa6",
72+
"categoryNames": [
73+
"swim",
74+
"gear"
75+
]
76+
}
9277
]
9378
```
9479

95-
## <a id="Iteration"></a>Iteration
96-
97-
The API for NoSQL provides support for iterating over JSON arrays, with the [IN keyword](keywords.md#in) in the FROM source. In the following example:
98-
99-
```sql
100-
SELECT *
101-
FROM Families.children
102-
```
103-
104-
The results are:
80+
## Iteration
10581

106-
```json
107-
[
108-
[
109-
{
110-
"firstName": "Henriette Thaulow",
111-
"gender": "female",
112-
"grade": 5,
113-
"pets": [{ "givenName": "Fluffy"}]
114-
}
115-
],
116-
[
117-
{
118-
"familyName": "Merriam",
119-
"givenName": "Jesse",
120-
"gender": "female",
121-
"grade": 1
122-
},
123-
{
124-
"familyName": "Miller",
125-
"givenName": "Lisa",
126-
"gender": "female",
127-
"grade": 8
128-
}
129-
]
130-
]
131-
```
82+
The API for NoSQL provides support for iterating over JSON arrays, with the [``IN`` keyword](keywords.md#in) in the ``FROM`` source.
13283

133-
The next query performs iteration over `children` in the `Families` container. The output array is different from the preceding query. This example splits `children`, and flattens the results into a single array:
84+
As an example, the next query performs iteration over ``tags`` for each item in the container. The output splits the array value and flattens the results into a single array.
13485

13586
```sql
136-
SELECT *
137-
FROM c IN Families.children
87+
SELECT
88+
*
89+
FROM
90+
products IN products.categories
13891
```
13992

140-
The results are:
141-
14293
```json
14394
[
14495
{
145-
"firstName": "Henriette Thaulow",
146-
"gender": "female",
147-
"grade": 5,
148-
"pets": [{ "givenName": "Fluffy" }]
149-
},
150-
{
151-
"familyName": "Merriam",
152-
"givenName": "Jesse",
153-
"gender": "female",
154-
"grade": 1
96+
"name": "swim"
15597
},
15698
{
157-
"familyName": "Miller",
158-
"givenName": "Lisa",
159-
"gender": "female",
160-
"grade": 8
99+
"name": "gear"
161100
}
162101
]
163102
```
164103

165104
You can filter further on each individual entry of the array, as shown in the following example:
166105

167106
```sql
168-
SELECT c.givenName
169-
FROM c IN Families.children
170-
WHERE c.grade = 8
107+
SELECT VALUE
108+
p.name
109+
FROM
110+
p IN p.categories
111+
WHERE
112+
p.name LIKE "ge%"
171113
```
172114

173115
The results are:
174116

175117
```json
176-
[{
177-
"givenName": "Lisa"
178-
}]
118+
[
119+
"gear"
120+
]
179121
```
180122

181-
You can also aggregate over the result of an array iteration. For example, the following query counts the number of children among all families:
123+
You can also aggregate over the result of an array iteration. For example, the following query counts the number of tags:
182124

183125
```sql
184-
SELECT COUNT(1) AS Count
185-
FROM child IN Families.children
126+
SELECT VALUE
127+
COUNT(1)
128+
FROM
129+
p IN p.categories
186130
```
187131

188132
The results are:
189133

190134
```json
191135
[
192-
{
193-
"Count": 3
194-
}
136+
2
195137
]
196138
```
197139

198140
> [!NOTE]
199-
> When using the IN keyword for iteration, you cannot filter or project any properties outside of the array. Instead, you should use [JOINs](join.md).
200-
201-
For additional examples, read our [blog post on working with arrays in Azure Cosmos DB](https://devblogs.microsoft.com/cosmosdb/understanding-how-to-query-arrays-in-azure-cosmos-db/).
141+
> When using the ``IN`` keyword for iteration, you cannot filter or project any properties outside of the array. Instead, you should use [self-joins](join.md).
202142
203143
## Next steps
204144

205-
- [Getting started](getting-started.md)
206-
- [Azure Cosmos DB .NET samples](https://github.com/Azure/azure-cosmos-dotnet-v3)
207-
- [Joins](join.md)
145+
- [Self-joins](join.md)
146+
- [Keywords](keywords.md)
147+
- [Subqueries](subquery.md)

0 commit comments

Comments
 (0)