Skip to content

Commit 3808c5b

Browse files
Merge pull request #245654 from seesharprun/cosmos-populate-nosql-4
Cosmos DB | Add NoSQL query functions #6
2 parents 27a8173 + 593ca9c commit 3808c5b

File tree

11 files changed

+77
-211
lines changed

11 files changed

+77
-211
lines changed

articles/cosmos-db/nosql/query/intadd.md

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.reviewer: sidandrews
88
ms.service: cosmos-db
99
ms.subservice: nosql
1010
ms.topic: reference
11-
ms.date: 07/01/2023
11+
ms.date: 07/20/2023
1212
ms.custom: query-reference
1313
---
1414

@@ -33,28 +33,18 @@ IntAdd(<int_expr_1>, <int_expr_2>)
3333

3434
## Return types
3535

36-
Returns a 64-bit integer. For more information, see [__int64](/cpp/cpp/int8-int16-int32-int64).
36+
Returns a 64-bit integer.
37+
38+
> [!NOTE]
39+
> For more information, see [__int64](/cpp/cpp/int8-int16-int32-int64).
3740
3841
## Examples
3942

4043
This example tests the function with various static values.
4144

42-
```sql
43-
SELECT VALUE {
44-
addNumber: IntAdd(20, 10),
45-
addZero: IntAdd(20, 0),
46-
addDecimal: IntAdd(20, 0.10)
47-
}
48-
```
45+
:::code language="sql" source="~/cosmos-db-nosql-query-samples/scripts/intadd/query.sql" highlight="2-4":::
4946

50-
```json
51-
[
52-
{
53-
"addNumber": 30,
54-
"addZero": 20
55-
}
56-
]
57-
```
47+
:::code language="json" source="~/cosmos-db-nosql-query-samples/scripts/intadd/result.json":::
5848

5949
## Remarks
6050

articles/cosmos-db/nosql/query/intbitand.md

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.reviewer: sidandrews
88
ms.service: cosmos-db
99
ms.subservice: nosql
1010
ms.topic: reference
11-
ms.date: 07/01/2023
11+
ms.date: 07/20/2023
1212
ms.custom: query-reference
1313
---
1414

@@ -33,30 +33,18 @@ IntBitAnd(<int_expr_1>, <int_expr_2>)
3333

3434
## Return types
3535

36-
Returns a 64-bit integer. For more information, see [__int64](/cpp/cpp/int8-int16-int32-int64).
36+
Returns a 64-bit integer.
37+
38+
> [!NOTE]
39+
> For more information, see [__int64](/cpp/cpp/int8-int16-int32-int64).
3740
3841
## Examples
3942

4043
This example tests the function with various static values.
4144

42-
```sql
43-
SELECT VALUE {
44-
compareNumbers: IntBitAnd(15, 25),
45-
compareZero: IntBitAnd(15, 0),
46-
compareSameNumber: IntBitAnd(15, 15),
47-
compareDecimal: IntBitAnd(15, 1.5)
48-
}
49-
```
45+
:::code language="sql" source="~/cosmos-db-nosql-query-samples/scripts/intbitand/query.novalidate.sql" highlight="2-5":::
5046

51-
```json
52-
[
53-
{
54-
"compareNumbers": 9,
55-
"compareZero": 0,
56-
"compareSameNumber": 15
57-
}
58-
]
59-
```
47+
:::code language="json" source="~/cosmos-db-nosql-query-samples/scripts/intbitand/result.novalidate.json":::
6048

6149
## Remarks
6250

articles/cosmos-db/nosql/query/intbitleftshift.md

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.reviewer: sidandrews
88
ms.service: cosmos-db
99
ms.subservice: nosql
1010
ms.topic: reference
11-
ms.date: 07/01/2023
11+
ms.date: 07/20/2023
1212
ms.custom: query-reference
1313
---
1414

@@ -33,26 +33,18 @@ IntBitLeftShift(<int_expr_1>, <int_expr_2>)
3333

3434
## Return types
3535

36-
Returns a 64-bit integer. For more information, see [__int64](/cpp/cpp/int8-int16-int32-int64).
36+
Returns a 64-bit integer.
37+
38+
> [!NOTE]
39+
> For more information, see [__int64](/cpp/cpp/int8-int16-int32-int64).
3740
3841
## Examples
3942

4043
This example tests the function with various static values.
4144

42-
```sql
43-
SELECT VALUE {
44-
shiftInteger: IntBitLeftShift(16, 4),
45-
shiftDecimal: IntBitLeftShift(16, 0.4)
46-
}
47-
```
45+
:::code language="sql" source="~/cosmos-db-nosql-query-samples/scripts/intbitleftshift/query.novalidate.sql" highlight="2-3":::
4846

49-
```json
50-
[
51-
{
52-
"shiftInteger": 256
53-
}
54-
]
55-
```
47+
:::code language="json" source="~/cosmos-db-nosql-query-samples/scripts/intbitleftshift/result.novalidate.json":::
5648

5749
## Remarks
5850

articles/cosmos-db/nosql/query/intbitnot.md

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.reviewer: sidandrews
88
ms.service: cosmos-db
99
ms.subservice: nosql
1010
ms.topic: reference
11-
ms.date: 07/01/2023
11+
ms.date: 07/20/2023
1212
ms.custom: query-reference
1313
---
1414

@@ -32,28 +32,18 @@ IntBitNot(<int_expr>)
3232

3333
## Return types
3434

35-
Returns a 64-bit integer. For more information, see [__int64](/cpp/cpp/int8-int16-int32-int64).
35+
Returns a 64-bit integer.
36+
37+
> [!NOTE]
38+
> For more information, see [__int64](/cpp/cpp/int8-int16-int32-int64).
3639
3740
## Examples
3841

3942
This example tests the function with various static values.
4043

41-
```sql
42-
SELECT VALUE {
43-
complementNumber: IntBitNot(65),
44-
complementZero: IntBitNot(0),
45-
complementDecimal: IntBitNot(0.1)
46-
}
47-
```
44+
:::code language="sql" source="~/cosmos-db-nosql-query-samples/scripts/intbitnot/query.novalidate.sql" highlight="2-4":::
4845

49-
```json
50-
[
51-
{
52-
"complementNumber": -66,
53-
"complementZero": -1
54-
}
55-
]
56-
```
46+
:::code language="json" source="~/cosmos-db-nosql-query-samples/scripts/intbitnot/result.novalidate.json":::
5747

5848
## Remarks
5949

articles/cosmos-db/nosql/query/intbitor.md

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.reviewer: sidandrews
88
ms.service: cosmos-db
99
ms.subservice: nosql
1010
ms.topic: reference
11-
ms.date: 07/01/2023
11+
ms.date: 07/20/2023
1212
ms.custom: query-reference
1313
---
1414

@@ -33,30 +33,18 @@ IntBitOr(<int_expr_1>, <int_expr_2>)
3333

3434
## Return types
3535

36-
Returns a 64-bit integer. For more information, see [__int64](/cpp/cpp/int8-int16-int32-int64).
36+
Returns a 64-bit integer.
37+
38+
> [!NOTE]
39+
> For more information, see [__int64](/cpp/cpp/int8-int16-int32-int64).
3740
3841
## Examples
3942

4043
This example tests the function with various static values.
4144

42-
```sql
43-
SELECT VALUE {
44-
inclusiveOr: IntBitOr(56, 100),
45-
inclusiveOrSame: IntBitOr(56, 56),
46-
inclusiveOrZero: IntBitOr(56, 0),
47-
inclusiveOrDecimal: IntBitOr(56, 0.1)
48-
}
49-
```
45+
:::code language="sql" source="~/cosmos-db-nosql-query-samples/scripts/intbitor/query.novalidate.sql" highlight="2-5":::
5046

51-
```json
52-
[
53-
{
54-
"inclusiveOr": 124,
55-
"inclusiveOrSame": 56,
56-
"inclusiveOrZero": 56
57-
}
58-
]
59-
```
47+
:::code language="json" source="~/cosmos-db-nosql-query-samples/scripts/intbitor/result.novalidate.json":::
6048

6149
## Remarks
6250

articles/cosmos-db/nosql/query/intbitrightshift.md

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.reviewer: sidandrews
88
ms.service: cosmos-db
99
ms.subservice: nosql
1010
ms.topic: reference
11-
ms.date: 07/01/2023
11+
ms.date: 07/20/2023
1212
ms.custom: query-reference
1313
---
1414

@@ -33,26 +33,18 @@ IntBitRightShift(<int_expr_1>, <int_expr_2>)
3333

3434
## Return types
3535

36-
Returns a 64-bit integer. For more information, see [__int64](/cpp/cpp/int8-int16-int32-int64).
36+
Returns a 64-bit integer.
37+
38+
> [!NOTE]
39+
> For more information, see [__int64](/cpp/cpp/int8-int16-int32-int64).
3740
3841
## Examples
3942

4043
This example tests the function with various static values.
4144

42-
```sql
43-
SELECT VALUE {
44-
shiftInteger: IntBitRightShift(16, 4),
45-
shiftDecimal: IntBitRightShift(16, 0.4)
46-
}
47-
```
45+
:::code language="sql" source="~/cosmos-db-nosql-query-samples/scripts/intbitrightshift/query.novalidate.sql" highlight="2-3":::
4846

49-
```json
50-
[
51-
{
52-
"shiftInteger": 1
53-
}
54-
]
55-
```
47+
:::code language="json" source="~/cosmos-db-nosql-query-samples/scripts/intbitrightshift/result.novalidate.json":::
5648

5749
## Remarks
5850

articles/cosmos-db/nosql/query/intbitxor.md

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.reviewer: sidandrews
88
ms.service: cosmos-db
99
ms.subservice: nosql
1010
ms.topic: reference
11-
ms.date: 07/01/2023
11+
ms.date: 07/20/2023
1212
ms.custom: query-reference
1313
---
1414

@@ -33,30 +33,18 @@ IntBitXor(<int_expr_1>, <int_expr_2>)
3333

3434
## Return types
3535

36-
Returns a 64-bit integer. For more information, see [__int64](/cpp/cpp/int8-int16-int32-int64).
36+
Returns a 64-bit integer.
37+
38+
> [!NOTE]
39+
> For more information, see [__int64](/cpp/cpp/int8-int16-int32-int64).
3740
3841
## Examples
3942

4043
This example tests the function with various static values.
4144

42-
```sql
43-
SELECT VALUE {
44-
exclusiveOr: IntBitXor(56, 100),
45-
exclusiveOrSame: IntBitXor(56, 56),
46-
exclusiveOrZero: IntBitXor(56, 0),
47-
exclusiveOrDecimal: IntBitXor(56, 0.1)
48-
}
49-
```
45+
:::code language="sql" source="~/cosmos-db-nosql-query-samples/scripts/intbitxor/query.novalidate.sql" highlight="2-5":::
5046

51-
```json
52-
[
53-
{
54-
"exclusiveOr": 92,
55-
"exclusiveOrSame": 0,
56-
"exclusiveOrZero": 56
57-
}
58-
]
59-
```
47+
:::code language="json" source="~/cosmos-db-nosql-query-samples/scripts/intbitxor/result.novalidate.json":::
6048

6149
## Remarks
6250

articles/cosmos-db/nosql/query/intdiv.md

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.reviewer: sidandrews
88
ms.service: cosmos-db
99
ms.subservice: nosql
1010
ms.topic: reference
11-
ms.date: 07/01/2023
11+
ms.date: 07/20/2023
1212
ms.custom: query-reference
1313
---
1414

@@ -33,33 +33,18 @@ IntDiv(<int_expr_1>, <int_expr_2>)
3333

3434
## Return types
3535

36-
Returns a 64-bit integer. For more information, see [__int64](/cpp/cpp/int8-int16-int32-int64).
36+
Returns a 64-bit integer.
37+
38+
> [!NOTE]
39+
> For more information, see [__int64](/cpp/cpp/int8-int16-int32-int64).
3740
3841
## Examples
3942

4043
This example tests the function with various static values.
4144

42-
```sql
43-
SELECT VALUE {
44-
divide: IntDiv(10, 2),
45-
negativeResult: IntDiv(10, -2),
46-
positiveResult: IntDiv(-10, -2),
47-
resultOne: IntDiv(10, 10),
48-
divideZero: IntDiv(10, 0),
49-
divideDecimal: IntDiv(10, 0.1)
50-
}
51-
```
45+
:::code language="sql" source="~/cosmos-db-nosql-query-samples/scripts/intdiv/query.sql" highlight="2-7":::
5246

53-
```json
54-
[
55-
{
56-
"divide": 5,
57-
"negativeResult": -5,
58-
"positiveResult": 5,
59-
"resultOne": 1
60-
}
61-
]
62-
```
47+
:::code language="json" source="~/cosmos-db-nosql-query-samples/scripts/intdiv/result.json":::
6348

6449
## Remarks
6550

0 commit comments

Comments
 (0)