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/merge.md
+54-3Lines changed: 54 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,11 +92,25 @@ Install-Module @parameters
92
92
93
93
Use [`az extension add`](/cli/azure/extension#az-extension-add) to install the [cosmosdb-preview](https://github.com/azure/azure-cli-extensions/tree/main/src/cosmosdb-preview) Azure CLI extension.
94
94
95
+
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+
95
105
```azurecli-interactive
96
106
az extension add \
97
107
--name cosmosdb-preview
98
108
```
99
109
110
+
111
+
112
+
113
+
100
114
---
101
115
102
116
#### [API for NoSQL](#tab/nosql/azure-powershell)
@@ -138,6 +152,24 @@ az cosmosdb sql container merge \
138
152
--name '<cosmos-container-name>'
139
153
```
140
154
155
+
For **shared throughput databases**, start the merge by using `az cosmosdb sql database merge`.
156
+
157
+
158
+
159
+
160
+
161
+
```azurecli
162
+
az cosmosdb sql database merge \
163
+
--account-name '<cosmos-account-name>'
164
+
--name '<cosmos-database-name>'
165
+
--resource-group '<resource-group-name>'
166
+
```
167
+
168
+
169
+
```http
170
+
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/partitionMerge?api-version=2023-11-15-preview
171
+
```
172
+
141
173
#### [API for MongoDB](#tab/mongodb/azure-powershell)
142
174
143
175
Use `Invoke-AzCosmosDBMongoDBCollectionMerge` with the `-WhatIf` parameter to preview the merge without actually performing the operation.
Start the merge by using [`az cosmosdb mongodb collection merge`](/cli/azure/cosmosdb/mongodb/collection#az-cosmosdb-mongodb-collection-merge).
202
+
For **shared-throughput databases**, start the merge by using [`az cosmosdb mongodb database merge`](/cli/azure/cosmosdb/mongodb/database?view=azure-cli-latest).
203
+
204
+
205
+
206
+
```azurecli
207
+
az cosmosdb mongodb database merge \
208
+
--account-name '<cosmos-account-name>'
209
+
--name '<cosmos-database-name>'
210
+
--resource-group '<resource-group-name>'
211
+
```
212
+
213
+
214
+
```http
215
+
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/partitionMerge?api-version=2023-11-15-preview
216
+
```
217
+
218
+
For **provisioned containers**, start the merge by using [`az cosmosdb mongodb collection merge`](/cli/azure/cosmosdb/mongodb/collection#az-cosmosdb-mongodb-collection-merge).
171
219
172
220
```azurecli-interactive
173
221
az cosmosdb mongodb collection merge \
174
222
--resource-group '<resource-group-name>' \
175
223
--account-name '<cosmos-account-name>' \
176
224
--database-name '<cosmos-database-name>' \
177
225
--name '<cosmos-collection-name>'
226
+
178
227
```
179
228
229
+
230
+
231
+
180
232
---
181
233
182
234
### Monitor merge operations
@@ -197,8 +249,6 @@ To enroll in the preview, your Azure Cosmos DB account must meet all the followi
197
249
198
250
- Your Azure Cosmos DB account uses API for NoSQL or MongoDB with version >=3.6.
199
251
- Your Azure Cosmos DB account is using provisioned throughput (manual or autoscale). Merge doesn't apply to serverless accounts.
200
-
- Currently, merge isn't supported for shared throughput databases. You may enroll an account that has both shared throughput databases and containers with dedicated throughput (manual or autoscale).
201
-
- However, only the containers with dedicated throughput are able to be merged.
202
252
- Your Azure Cosmos DB account is a single-write region account (merge isn't currently supported for multi-region write accounts).
203
253
- Your Azure Cosmos DB account doesn't use any of the following features:
0 commit comments