Skip to content

Commit d617e3c

Browse files
committed
Acrolinx fixes
1 parent 5456815 commit d617e3c

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

articles/cosmos-db/nosql/query/computed-properties.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -59,21 +59,21 @@ The constraints on computed property names are:
5959

6060
### Query constraints
6161

62-
Queries in the computed property definition must be valid syntactically and semantically, otherwise the create or update operation fails. Queries should evaluate to a deterministic value for all items in a container. Queries may evaluate to undefined or null for some items, and computed properties with undefined or null values behave the same as persisted properties with undefined or null values when used in queries.
62+
Queries in the computed property definition must be valid syntactically and semantically, otherwise the create or update operation fails. Queries should evaluate to a deterministic value for all items in a container. Queries might evaluate to undefined or null for some items, and computed properties with undefined or null values behave the same as persisted properties with undefined or null values when used in queries.
6363

6464
The limitations on computed property query definitions are:
6565

6666
- Queries must specify a FROM clause that represents the root item reference. Examples of supported FROM clauses are: `FROM c`, `FROM root c`, and `FROM MyContainer c`.
6767
- Queries must use a VALUE clause in the projection.
6868
- Queries can't include a JOIN.
69-
- Queries can't use non-deterministic Scalar expressions. Examples of non-deterministic scalar expressions are: GetCurrentDateTime, GetCurrentTimeStamp, GetCurrentTicks, and RAND.
69+
- Queries can't use nondeterministic Scalar expressions. Examples of nondeterministic scalar expressions are: GetCurrentDateTime, GetCurrentTimeStamp, GetCurrentTicks, and RAND.
7070
- Queries can't use any of the following clauses: WHERE, GROUP BY, ORDER BY, TOP, DISTINCT, OFFSET LIMIT, EXISTS, ALL, LAST, FIRST, and NONE.
7171
- Queries can't include a scalar subquery.
7272
- Aggregate functions, spatial functions, nondeterministic functions, and user defined functions (UDFs) aren't supported.
7373

7474
## Create computed properties
7575

76-
After the computed properties are created, you can execute queries that reference the properties by using any method, including all SDKs and Azure Data Explorer in the Azure portal.
76+
After the computed properties are created, you can execute queries that reference the properties by using any method, including all software development kits (SDKs) and Azure Data Explorer in the Azure portal.
7777

7878
| | Supported version | Notes |
7979
| --- | --- | --- |
@@ -142,7 +142,7 @@ const { container: containerWithComputedProperty } = await database.containers.c
142142

143143
### [Python](#tab/python)
144144

145-
You can define multiple computed properties in a list and then add them to the container properties. Python SDK currently doesn't support computed properties on existing containers.
145+
You can define multiple computed properties in a list and then add them to the container properties. Python SDK currently doesn't support computed properties on existing containers.
146146

147147
```python
148148
computed_properties = [{'name': "cp_lower", 'query': "SELECT VALUE LOWER(c.db_group) FROM c"},
@@ -152,14 +152,14 @@ computed_properties = [{'name': "cp_lower", 'query': "SELECT VALUE LOWER(c.db_gr
152152
container_with_computed_props = db.create_container_if_not_exists(
153153
"myContainer", PartitionKey(path="/pk"), computed_properties=computed_properties)
154154
```
155+
155156
Computed properties can be used like any other property in queries. For example, you can use the computed property `cp_lower` in a query like this:
156157

157158
```python
158159
queried_items = list(
159160
container_with_computed_props.query_items(query='Select * from c Where c.cp_power = 25', partition_key="test"))
160161
```
161162

162-
163163
---
164164

165165
Here's an example of how to update computed properties on an existing container:
@@ -218,7 +218,8 @@ console.log("Container definition is undefined.");
218218
```
219219

220220
### [Python](#tab/python)
221-
Updating computed properties on an existing container is not supported in Python SDK. You can only define computed properties when creating a new container. This is a work in progress currently.
221+
222+
Updating computed properties on an existing container isn't supported in Python SDK. You can only define computed properties when creating a new container.
222223

223224
---
224225

@@ -231,9 +232,9 @@ You can use the Data Explorer to create a computed property for a container.
231232

232233
1. Open your existing container in the Data Explorer.
233234

234-
1. Navigate to the **Settings** section for you container. Then, navigate to the **Computed Properties* sub-section.
235+
1. Navigate to the **Settings** section for your container. Then, navigate to the **Computed Properties* subsection.
235236

236-
1. Edit the computed properties definition JSON for your container. In this example, this JSON is used to define a computed property to split the `SKU` string for a retail product using the `-` delimeter.
237+
1. Edit the computed properties definition JSON for your container. In this example, this JSON is used to define a computed property to split the `SKU` string for a retail product using the `-` delimiter.
237238

238239
```json
239240
[
@@ -382,14 +383,14 @@ ORDER BY
382383

383384
## Index computed properties
384385

385-
Computed properties aren't indexed by default and aren't covered by wildcard paths in the [indexing policy](../../index-policy.md). You can add single or composite indexes on computed properties in the indexing policy the same way you would add indexes on persisted properties. We recommend that you add relevant indexes to all computed properties. We recommend these indexes because they're beneficial in increasing performance and reducing RUs when they're indexed. When computed properties are indexed, actual values are evaluated during item write operations to generate and persist index terms.
386+
Computed properties aren't indexed by default and aren't covered by wildcard paths in the [indexing policy](../../index-policy.md). You can add single or composite indexes on computed properties in the indexing policy the same way you would add indexes on persisted properties. We recommend that you add relevant indexes to all computed properties. We recommend these indexes because they're beneficial in increasing performance and reducing request units (RUs). When computed properties are indexed, actual values are evaluated during item write operations to generate and persist index terms.
386387

387388
There are a few considerations for indexing computed properties, including:
388389

389-
- Computed properties can be specified in included paths, excluded paths, and composite index paths.
390-
- Computed properties can't have a spatial index defined on them.
391-
- Wildcard paths under the computed property path work like they do for regular properties.
392-
- If you're removing a computed property that has been indexed, all indexes on that property must also be dropped.
390+
- Computed properties can be specified in included paths, excluded paths, and composite index paths
391+
- Computed properties can't have a spatial index defined on them
392+
- Wildcard paths under the computed property path work like they do for regular properties
393+
- Related indexes on a removed and indexed property must also be dropped
393394

394395
> [!NOTE]
395396
> All computed properties are defined at the top level of the item. The path is always `/<computed property name>`.
@@ -402,7 +403,6 @@ There are a few considerations for indexing computed properties, including:
402403
>
403404
> If you want to delete a computed property, you'll first need to remove it from the index policy.
404405
405-
406406
### Add a single index for computed properties
407407

408408
To add a single index for a computed property named `cp_myComputedProperty`:
@@ -460,7 +460,7 @@ To add a composite index on two properties in which, one is computed as `cp_myCo
460460

461461
## Understand request unit consumption
462462

463-
Adding computed properties to a container doesn't consume RUs. Write operations on containers that have computed properties defined might have a slight RU increase. If a computed property is indexed, RUs on write operations increase to reflect the costs for indexing and evaluation of the computed property.
463+
Adding computed properties to a container doesn't consume RUs. Write operations on containers that have computed properties defined might have a slight RU increase. If a computed property is indexed, RUs on write operations increase to reflect the costs for indexing and evaluation of the computed property.
464464

465465
## Related content
466466

0 commit comments

Comments
 (0)