Skip to content

Commit 5b9b4a9

Browse files
committed
incorporated feedback and changed github repo for sample
1 parent 0ea56d6 commit 5b9b4a9

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

articles/cosmos-db/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,8 @@
660660
href: create-mongodb-xamarin.md
661661
- name: Golang
662662
href: create-mongodb-golang.md
663+
- name: Go
664+
href: create-mongodb-go.md
663665
- name: Tutorials
664666
items:
665667
- name: 1 - Create and manage data

articles/cosmos-db/create-mongodb-go.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Run the following commands to clone the sample repository.
5252
3. Run the following command to clone the sample repository. This command creates a copy of the sample app on your computer.
5353

5454
```bash
55-
git clone https://github.com/abhirockzz/monogdb-go-quickstart
55+
git clone https://github.com/Azure-Samples/cosmosdb-go-mongodb-quickstart
5656
```
5757

5858
## Review the code
@@ -68,7 +68,7 @@ This step is optional. If you're interested in learning how the application work
6868
6969
The following snippets are all taken from the `todo.go` file.
7070
71-
### Connecting the Go app to Cosmos DB
71+
### Connecting the Go app to Azure Cosmos DB
7272
7373
[`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)
7474
@@ -94,7 +94,7 @@ The following snippets are all taken from the `todo.go` file.
9494
> Using the [`SetDirect(true)`](https://pkg.go.dev/go.mongodb.org/[email protected]/mongo/options?tab=doc#ClientOptions.SetDirect) configuration is important, without which you will get the following connectivity error: `unable to connect connection(cdb-ms-prod-<azure-region>-cm1.documents.azure.com:10255[-4]) connection is closed`
9595
>
9696
97-
### Create a `todo`
97+
### Create a `todo` item
9898
9999
To create a `todo`, we get a handle to a [`mongo.Collection`](https://pkg.go.dev/go.mongodb.org/[email protected]/mongo?tab=doc#Collection) and invoke the [`InsertOne`](https://pkg.go.dev/go.mongodb.org/[email protected]/mongo?tab=doc#Collection.InsertOne) function.
100100
@@ -120,7 +120,7 @@ type Todo struct {
120120
Status string `bson:"status"`
121121
}
122122
```
123-
### List `todo`s
123+
### List `todo` items
124124
125125
We can list TODOs based on criteria. A [`bson.D`](https://pkg.go.dev/go.mongodb.org/[email protected]/bson?tab=doc#D) is created to encapsulate the filter criteria
126126
@@ -174,7 +174,7 @@ Finally, the information is rendered in tabular format
174174
table.Render()
175175
```
176176
177-
### Update a `todo`
177+
### Update a `todo` item
178178
179179
A `todo` can be updated based on its `_id`. A [`bson.D`](https://pkg.go.dev/go.mongodb.org/[email protected]/bson?tab=doc#D) filter is created based on the `_id` and another one is created for the updated information, which is a new status (`completed` or `pending`) in this case. Finally, the [`UpdateOne`](https://pkg.go.dev/go.mongodb.org/[email protected]/mongo?tab=doc#Collection.UpdateOne) function is invoked with the filter and the updated document
180180
@@ -417,7 +417,7 @@ To view, query, and work with the user data created in the previous step, login
417417
418418
In the top Search box, enter **Azure Cosmos DB**. When your Cosmos account blade opens, select your Cosmos account. In the left navigation, select **Data Explorer**. Expand your collection in the Collections pane, and then you can view the documents in the collection, query the data, and even create and run stored procedures, triggers, and UDFs.
419419
420-
![Data Explorer showing the newly created document](./media/create-mongodb-go/go-cosmos-db-data-explorer.png)
420+
![Data Explorer showing the newly created document](./media/create-mongodb-go/go-cosmos-db-data-explorer.jpg)
421421
422422
423423
Delete a `todo` using it's ID
133 KB
Loading
Binary file not shown.

0 commit comments

Comments
 (0)