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/how-to-configure-capabilities.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ Capabilities are features that can be added or removed to your API for MongoDB a
20
20
## Prerequisites
21
21
22
22
- An Azure account with an active subscription. [Create an account for free](https://aka.ms/trycosmosdb).
23
-
- An Azure Cosmos DB for MongoDB account. [Create an API for MongoDB account](quickstart-nodejs.md#create-an-azure-cosmos-db-account).
23
+
- An Azure Cosmos DB for MongoDB account. [Create an API for MongoDB account](/azure/cosmos-db/how-to-manage-database-account).
24
24
-[Azure CLI](/cli/azure/) or Azure portal access. Changing capabilities via Azure Resource Manager isn't supported.
25
25
26
26
## Available capabilities
@@ -32,13 +32,13 @@ Capabilities are features that can be added or removed to your API for MongoDB a
32
32
|`EnableMongoRetryableWrites`| Enables support for retryable writes on the account. | Yes |
33
33
|`EnableMongo16MBDocumentSupport`| Enables support for inserting documents up to 16 MB in size. | No |
34
34
|`EnableUniqueCompoundNestedDocs`| Enables support for compound and unique indexes on nested fields if the nested field isn't an array. | No |
35
-
|`EnableTtlOnCustomPath`| Provides the ability to set a custom Time to Live (TTL) on any one field in a collection. Setting TTL on partial unique index property is not supported. ¹| No |
35
+
|`EnableTtlOnCustomPath`| Provides the ability to set a custom Time to Live (TTL) on any one field in a collection. Setting TTL on partial unique index property is not supported. <sup>1</sup>| No |
36
36
|`EnablePartialUniqueIndex`| Enables support for a unique partial index, so you have more flexibility to specify exactly which fields in documents you'd like to index. | No |
37
-
|`EnableUniqueIndexReIndex`| Enables support for unique index re-indexing for Cosmos DB for MongoDB RU. ¹| No |
37
+
|`EnableUniqueIndexReIndex`| Enables support for unique index re-indexing for Cosmos DB for MongoDB RU. <sup>1</sup>| No |
38
38
39
39
> [!NOTE]
40
40
>
41
-
> ¹ This capability cannot be enabled on an Azure Cosmos DB for MongoDB accounts with continuous backup.
41
+
> <sup>1</sup> This capability cannot be enabled on an Azure Cosmos DB for MongoDB accounts with continuous backup.
> GitHub accounts include an entitlement of storage and core hours at no cost. For more information, see [included storage and core hours for GitHub accounts](https://docs.github.com/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts).
16
+
17
+
::: zone-end
18
+
19
+
::: zone pivot="devcontainer-vscode"
20
+
21
+
::: zone-end
22
+
23
+
1. Open a terminal in the root directory of the project.
24
+
25
+
1. Authenticate to the Azure Developer CLI using `azd auth login`. Follow the steps specified by the tool to authenticate to the CLI using your preferred Azure credentials.
26
+
27
+
```azurecli
28
+
azd auth login
29
+
```
30
+
31
+
1. Use `azd init` to initialize the project.
32
+
33
+
```azurecli
34
+
azd init
35
+
```
36
+
37
+
1. During initialization, configure a unique environment name.
38
+
39
+
> [!TIP]
40
+
> The environment name will also be used as the target resource group name. For this quickstart, consider using `msdocs-cosmos-db-`.
41
+
42
+
1. Deploy the Azure Cosmos DB account using `azd up`. The Bicep templates also deploy a sample web application.
43
+
44
+
```azurecli
45
+
azd up
46
+
```
47
+
48
+
1. During the provisioning process, select your subscription and desired location. Wait for the provisioning process to complete. The process can take **approximately five minutes**.
49
+
50
+
1. Once the provisioning of your Azure resources is done, a URL to the running web application is included in the output.
Get started with the MongoDB npm package to create databases, collections, and docs within your Azure Cosmos DB resource. Follow these steps to install the package and try out example code for basic tasks.
28
29
29
30
> [!NOTE]
30
-
> The [example code snippets](https://github.com/Azure-Samples/cosmos-db-mongodb-api-javascript-samples) are available on GitHub as a JavaScript project.
31
+
> The [example code snippets](https://github.com/Azure-Samples/cosmos-db-mongodb-nodejs-quickstart) are available on GitHub as a JavaScript project.
31
32
32
-
[API for MongoDB reference documentation](https://docs.mongodb.com/drivers/node) | [MongoDB Package (NuGet)](https://www.npmjs.com/package/mongodb)
33
+
[API for MongoDB reference documentation](https://www.mongodb.com/docs/drivers/csharp) | [MongoDB Package (NuGet)](https://www.nuget.org/packages/MongoDB.Driver)
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free).
37
-
-[Node.js LTS](https://nodejs.org/en/download/)
38
-
-[Azure Command-Line Interface (CLI)](/cli/azure/) or [Azure PowerShell](/powershell/azure/)
39
-
40
-
### Prerequisite check
41
-
42
-
- In a terminal or command window, run ``node --version`` to check that Node.js is one of the LTS versions.
43
-
- Run ``az --version`` (Azure CLI) or ``Get-Module -ListAvailable AzureRM`` (Azure PowerShell) to check that you have the appropriate Azure command-line tools installed.
This section walks you through creating an Azure Cosmos DB account and setting up a project that uses the MongoDB npm package.
48
-
49
-
### Create an Azure Cosmos DB account
42
+
Deploy this project's development container to your environment. Then, use the Azure Developer CLI (`azd`) to create an Azure Cosmos DB for MongoDB account and deploy a containerized sample application. The sample application uses the client library to manage, create, read, and query sample data.
50
43
51
-
This quickstart will create a single Azure Cosmos DB account using the API for MongoDB.
44
+
::: zone pivot="devcontainer-codespace"
52
45
53
-
#### [Azure CLI](#tab/azure-cli)
46
+
[](https://codespaces.new/Azure-Samples/cosmos-db-mongodb-nodejs-quickstart?template=false&quickstart=1&azure-portal=true)
[!INCLUDE [Powershell - create resource group and resources](./includes/powershell-create-resource-group-and-resource.md)]
52
+
[](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/Azure-Samples/cosmos-db-mongodb-nodejs-quickstart)
[!INCLUDE [Azure CLI - get connection string](./includes/azure-cli-get-connection-string.md)]
72
-
73
-
#### [PowerShell](#tab/azure-powershell)
74
-
75
-
[!INCLUDE [Powershell - get connection string](./includes/powershell-get-connection-string.md)]
76
-
77
-
#### [Portal](#tab/azure-portal)
78
-
79
-
[!INCLUDE [Portal - get connection string](./includes/portal-get-connection-string-from-resource.md)]
80
-
81
-
---
82
-
83
-
### Create a new JavaScript app
84
-
85
-
Create a new JavaScript application in an empty folder using your preferred terminal. Use the [``npm init``](https://docs.npmjs.com/cli/v8/commands/npm-init) command to begin the prompts to create the `package.json` file. Accept the defaults for the prompts.
86
-
87
-
```console
88
-
npm init
89
-
```
90
-
91
60
### Install the package
92
61
93
62
Add the [MongoDB](https://www.npmjs.com/package/mongodb) npm package to the JavaScript project. Use the [``npm install package``](https://docs.npmjs.com/cli/v8/commands/npm-install) command specifying the name of the npm package. The `dotenv` package is used to read the environment variables from a `.env` file during local development.
@@ -96,10 +65,6 @@ Add the [MongoDB](https://www.npmjs.com/package/mongodb) npm package to the Java
Before you start building the application, let's look into the hierarchy of resources in Azure Cosmos DB. Azure Cosmos DB has a specific object model used to create and access resources. The Azure Cosmos DB creates resources in a hierarchy that consists of accounts, databases, collections, and docs.
0 commit comments