You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cosmos-db/nosql/query/computed-properties.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,6 +79,7 @@ During the preview, computed properties must be created using the .NET v3 or Jav
79
79
| --- | --- | --- |
80
80
|**.NET SDK v3**| >= [3.34.0-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.34.0-preview)| Computed properties are currently available only in preview package versions. |
81
81
|**Java SDK v4**| >= [4.46.0](https://mvnrepository.com/artifact/com.azure/azure-cosmos/4.46.0)| Computed properties are currently under preview version. |
82
+
|**Python SDK**| >= [v4.5.2b5](https://pypi.org/project/azure-cosmos/4.5.2b5/)| Computed properties are currently under preview version. |
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.
120
+
121
+
```python
122
+
computed_properties = [{'name': "cp_lower", 'query': "SELECT VALUE LOWER(c.db_group) FROM c"},
123
+
{'name': "cp_power", 'query': "SELECT VALUE POWER(c.val, 2) FROM c"},
124
+
{'name': "cp_str_len", 'query': "SELECT VALUE LENGTH(c.stringProperty) FROM c"}]
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.
0 commit comments