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/create-mongodb-go.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,16 @@
1
1
---
2
-
title: 'Quickstart: Connect a Go MongoDB app to Azure Cosmos DB'
3
-
description: This quickstart demonstrates how to connect an existing MongoDB app written in Go to Azure Cosmos DB.
2
+
title: 'Quickstart: Connect a Go application to Azure Cosmos DB's API for MongoDB'
3
+
description: This quickstart demonstrates how to connect an existing Go application to Azure Cosmos DB's API for MongoDB.
4
4
author: abhishekgupta
5
5
ms.author: abhishgu
6
6
ms.service: cosmos-db
7
7
ms.subservice: cosmosdb-mongo
8
8
ms.devlang: go
9
9
ms.topic: quickstart
10
-
ms.date: 05/21/2019
10
+
ms.date: 04/24/2020
11
11
12
12
---
13
-
# Quickstart: Migrate an existing MongoDB Go app to Azure Cosmos DB
13
+
# Quickstart: Connect a Go application to Azure Cosmos DB's API for MongoDB
14
14
15
15
> [!div class="op_single_selector"]
16
16
> *[.NET](create-mongodb-dotnet.md)
@@ -21,7 +21,7 @@ ms.date: 05/21/2019
21
21
> *[Golang](create-mongodb-golang.md)
22
22
>
23
23
24
-
Azure Cosmos DB is a multi-model database service that lets you quickly create and query document, table, key-value, and graph databases with global distribution and horizontal scale capabilities. In this quickstart, you create and manage an Azure Cosmos DB for Mongo DB API account by using the Azure Cloud Shell, clone an existing sample application from GitHub and configure it to work with Azure Cosmos DB.
24
+
Azure Cosmos DB is a multi-model database service that lets you quickly create and query document, table, key-value, and graph databases with global distribution and horizontal scale capabilities. In this quickstart, you create and manage an Azure Cosmos DB account by using the Azure Cloud Shell, clone an existing sample application from GitHub and configure it to work with Azure Cosmos DB.
25
25
26
26
The sample application is a command-line based `todo` management tool written in Go. Azure Cosmos DB's API for MongoDB is [compatible with the MongoDB wire protocol](https://docs.microsoft.com/azure/cosmos-db/mongodb-introduction#wire-protocol-compatibility), making it possible for any MongoDB client driver to connect to it. This application uses the [Go driver for MongoDB](https://github.com/mongodb/mongo-go-driver) in a way that is transparent to the application that the data is stored in an Azure Cosmos DB database.
27
27
@@ -70,7 +70,7 @@ The following snippets are all taken from the `todo.go` file.
70
70
71
71
### Connecting the Go app to Cosmos DB
72
72
73
-
[`clientOptions`](https://pkg.go.dev/go.mongodb.org/[email protected]/mongo/options?tab=doc#ClientOptions) encapsulates the connection string for the Azure Cosmos DB MongoDB API, 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)
73
+
[`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)
0 commit comments