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/quickstart-go.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,7 +69,7 @@ The following snippets are all taken from the `todo.go` file.
69
69
70
70
### Connecting the Go app to Azure Cosmos DB
71
71
72
-
[`clientOptions`](https://pkg.go.dev/go.mongodb.org/[email protected]/mongo/options?tab=doc#ClientOptions) encapsulates the connection string for Azure Cosmos DB, which is passed in using an environment variable (details in the upcoming section). The connection is initialized using [`mongo.NewClient`](https://pkg.go.dev/go.mongodb.org/[email protected]/mongo?tab=doc#NewClient) to which the `clientOptions` instance is passed. [`Ping` function](https://pkg.go.dev/go.mongodb.org/[email protected]/mongo?tab=doc#Client.Ping) is invoked to confirm successful connectivity (itis a fail-fast strategy).
72
+
[`clientOptions`](https://pkg.go.dev/go.mongodb.org/[email protected]/mongo/options?tab=doc#ClientOptions) encapsulates the connection string for Azure Cosmos DB, which is passed in using an environment variable (details in the upcoming section). The connection is initialized using [`mongo.NewClient`](https://pkg.go.dev/go.mongodb.org/[email protected]/mongo?tab=doc#NewClient) to which the `clientOptions` instance is passed. [`Ping` function](https://pkg.go.dev/go.mongodb.org/[email protected]/mongo?tab=doc#Client.Ping) is invoked to confirm successful connectivity (it'is a fail-fast strategy).
A `todo` is deleted based on its `_id` and itis encapsulated in the form of a [`bson.D`](https://pkg.go.dev/go.mongodb.org/[email protected]/bson?tab=doc#D) instance. [`DeleteOne`](https://pkg.go.dev/go.mongodb.org/[email protected]/mongo?tab=doc#Collection.DeleteOne) is invoked to delete the document.
197
+
A `todo` is deleted based on its `_id` and it'is encapsulated in the form of a [`bson.D`](https://pkg.go.dev/go.mongodb.org/[email protected]/bson?tab=doc#D) instance. [`DeleteOne`](https://pkg.go.dev/go.mongodb.org/[email protected]/mongo?tab=doc#Collection.DeleteOne) is invoked to delete the document.
198
198
199
199
```go
200
200
func delete(todoid string) {
@@ -231,27 +231,27 @@ To confirm that the application was built properly.
231
231
232
232
### Sign in to Azure
233
233
234
-
If you choose to install and use the CLI locally, this topic requires that you are running the Azure CLI version 2.0 or later. Run `az --version` to find the version. If you need to install or upgrade, see [Install Azure CLI].
234
+
If you choose to install and use the CLI locally, this topic requires that you're running the Azure CLI version 2.0 or later. Run `az --version` to find the version. If you need to install or upgrade, see [Install Azure CLI].
235
235
236
-
If you are using an installed Azure CLI, sign in to your Azure subscription with the [az login](/cli/azure/reference-index#az-login) command and follow the on-screen directions. You can skip this step if you're using the Azure Cloud Shell.
236
+
If you're using an installed Azure CLI, sign in to your Azure subscription with the [az login](/cli/azure/reference-index#az-login) command and follow the on-screen directions. You can skip this step if you're using the Azure Cloud Shell.
237
237
238
238
```azurecli
239
239
az login
240
240
```
241
241
242
242
### Add the Azure Cosmos DB module
243
243
244
-
If you are using an installed Azure CLI, check to see if the `cosmosdb` component is already installed by running the `az` command. If `cosmosdb` is in the list of base commands, proceed to the next command. You can skip this step if you're using the Azure Cloud Shell.
244
+
If you're using an installed Azure CLI, check to see if the `cosmosdb` component is already installed by running the `az` command. If `cosmosdb` is in the list of base commands, proceed to the next command. You can skip this step if you're using the Azure Cloud Shell.
245
245
246
-
If `cosmosdb` is not in the list of base commands, reinstall [Azure CLI](/cli/azure/install-azure-cli).
246
+
If `cosmosdb`isn't in the list of base commands, reinstall [Azure CLI](/cli/azure/install-azure-cli).
247
247
248
248
### Create a resource group
249
249
250
250
Create a [resource group](../../azure-resource-manager/management/overview.md) with the [az group create](/cli/azure/group#az-group-create). An Azure resource group is a logical container into which Azure resources like web apps, databases, and storage accounts are deployed and managed.
251
251
252
252
The following example creates a resource group in the West Europe region. Choose a unique name for the resource group.
253
253
254
-
If you are using Azure Cloud Shell, select **Try It**, follow the onscreen prompts to log in, then copy the command into the command prompt.
254
+
If you're using Azure Cloud Shell, select**Try It**, follow the onscreen prompts to log in, then copy the command into the command prompt.
255
255
256
256
```azurecli-interactive
257
257
az group create --name myResourceGroup --location "West Europe"
@@ -430,7 +430,7 @@ List the `todo`s to confirm:
430
430
./todo --list all
431
431
```
432
432
433
-
The `todo` you just deleted should not be present:
0 commit comments