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/mongodb-custom-commands.md
+34-6Lines changed: 34 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -155,12 +155,15 @@ The create collection extension command creates a new MongoDB collection. The da
155
155
156
156
The following table describes the parameters within the command:
157
157
158
-
|**Field**|**Type**|**Description**|
158
+
|**Field**|**Type**|**Required**|**Description**|
159
159
|---------|---------|---------|
160
-
| customAction | string | Name of the custom command. Must be "CreateCollection" |
161
-
| collection | string | Name of the collection |
162
-
| offerThroughput | int | Provisioned Throughput to set on the database. It's an Optional parameter |
163
-
| shardKey | string | Shard Key path to create a sharded collection. It's an Optional parameter |
160
+
| customAction | string | Required | Name of the custom command. Must be "CreateCollection". |
161
+
| collection | string | Required | Name of the collection. No special characters are allowed. |
162
+
| offerThroughput | int | Optional*| Provisioned Throughput to set on the database. If it isn't provided, it will default to the minimum, 400 RU/s. * To specify throughput beyong 10,000 RU/s, the `shardKey` parameter will be required. |
163
+
| shardKey | string | Optional | Shard Key path to create a sharded collection. If it is specified, all documents inserted will require this value. |
164
+
| autopilotTier | int | Optional*| The tier of Autopilot RU/s. Accepted values are 1 through 4, which map to each one of the [Autopilot tiers](https://docs.microsoft.com/azure/cosmos-db/provision-throughput-autopilot#autopilot-limits) respectively. Can't be specified alongside the `offerThroughput` parameter. Any value greater than 1 will require the `shardKey` parameter. |
165
+
| autopilotAutoUpgrade | boolean | Optional*| Ability to automatically increase the Autopilot tier. *It requires `autopilotTier` to be specified, as well as the `shardKey` parameter. |
166
+
164
167
165
168
### Output
166
169
@@ -179,13 +182,38 @@ db.runCommand({customAction: "CreateCollection", collection: "testCollection", o
179
182
180
183
**Create a sharded collection**
181
184
182
-
To create a sharded collection with name "testCollection" and provisioned throughput of 1000 RUs, use the following command:
185
+
To create a sharded collection with name "testCollection" and provisioned throughput of 1000 RUs, and a shardkey property "a.b", use the following command:
To create a sharded Autopilot collection with name "testCollection" and with Autopilot Tier 3, which maps to 100,000 RUs, and a shardKey property "a.b", use the following command:
To create a sharded Autopilot collection with name "testCollection" and with Autopilot Tier 2, which maps to 20,000 RUs, a shardKey property "a.b", and the ability to auto increase the tier when needed, use the following command:
0 commit comments