Skip to content

Commit 4fb8076

Browse files
committed
Final read through.
1 parent 578bcaa commit 4fb8076

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

articles/cosmos-db/mongodb/includes/environment-variables-connection-string.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.topic: include
77
ms.date: 06/13/2019
88
ms.author: diberry
99
---
10-
To use the **CONNECTION STRING** values within your code, set this value on the local machine running the application. To set the environment variable, use your preferred terminal to run the following commands:
10+
To use the **CONNECTION STRING** values within your code, set this value in the local environment running the application. To set the environment variable, use your preferred terminal to run the following commands:
1111

1212
#### [Windows](#tab/windows)
1313

articles/cosmos-db/mongodb/quickstart-python.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ This quickstart will create a single Azure Cosmos DB account using the API for M
7777
1. Create a new empty folder using your preferred terminal and change directory to the folder.
7878

7979
> [!NOTE]
80-
> If you just want the finished code, download or fork and clone the [example code snippets](https://github.com/Azure-Samples/azure-cosmos-db-mongodb-python-getting-started) from GitHub that has the full example. You can also `git clone` the repo in Azure Cloud Shell to try out the code.
80+
> If you just want the finished code, download or fork and clone the [example code snippets](https://github.com/Azure-Samples/azure-cosmos-db-mongodb-python-getting-started) repo that has the full example. You can also `git clone` the repo in Azure Cloud Shell to walk through the steps shown in this quickstart.
8181
82-
2. Create a *requirements.txt* file with lines for the [PyMongo](https://www.mongodb.com/docs/drivers/pymongo/) and the [python-dotenv](https://pypi.org/project/python-dotenv/) packages.
82+
2. Create a *requirements.txt* file that lists the [PyMongo](https://www.mongodb.com/docs/drivers/pymongo/) and [python-dotenv](https://pypi.org/project/python-dotenv/) packages.
8383

8484
```text
8585
# requirements.txt
@@ -136,9 +136,9 @@ To learn more about the hierarchy of entities, see the [Azure Cosmos DB resource
136136
* [Get an document](#get-a-document)
137137
* [Query documents](#query-documents)
138138
139-
The sample code described in this article creates a database named `adventureworks` with a collection named `products`. The `products` collection is designed to contain product details such as name, category, quantity, and a sale indicator. Each product also contains a unique identifier. The complete sample code is at https://github.com/Azure-Samples/azure-cosmos-db-mongodb-python-getting-started/001-quickstart/.
139+
The sample code described in this article creates a database named `adventureworks` with a collection named `products`. The `products` collection is designed to contain product details such as name, category, quantity, and a sale indicator. Each product also contains a unique identifier. The complete sample code is at https://github.com/Azure-Samples/azure-cosmos-db-mongodb-python-getting-started/tree/main/001-quickstart/.
140140
141-
For the steps below, the database won't use sharding and shows a synchronous application using PyMongo. For asynchronous applications, use the [Motor](https://www.mongodb.com/docs/drivers/motor/) driver.
141+
For the steps below, the database won't use sharding and shows a synchronous application using the [PyMongo](https://www.mongodb.com/docs/drivers/pymongo/) driver. For asynchronous applications, use the [Motor](https://www.mongodb.com/docs/drivers/motor/) driver.
142142
143143
### Authenticate the client
144144
@@ -189,17 +189,17 @@ Create a document with the *product* properties for the `adventureworks` databas
189189
190190
:::code language="python" source="~/azure-cosmos-db-mongodb-python-getting-started/001-quickstart/run.py" id="new_doc":::
191191
192-
Create a document in the collection by calling the collection level operation [update_one](https://pymongo.readthedocs.io/en/stable/api/pymongo/collection.html#pymongo.collection.Collection.update_one). In this example, you'll *upsert* instead of *create* a new document in case you run this sample code more than once.
192+
Create a document in the collection by calling the collection level operation [update_one](https://pymongo.readthedocs.io/en/stable/api/pymongo/collection.html#pymongo.collection.Collection.update_one). In this example, you'll *upsert* instead of *create* a new document. Upsert isn't necessary in this example because the product *name* is random. However, it's a good practice to upsert in case you run the code more than once and the product name is the same.
193193
194-
The result of the `update_one` operation contains the `_id` field value that you can use in subsequent operations. The *_id* property was created automatically in this case.
194+
The result of the `update_one` operation contains the `_id` field value that you can use in subsequent operations. The *_id* property was created automatically.
195195
196196
### Get a document
197197
198198
Use the [find_one](https://pymongo.readthedocs.io/en/stable/api/pymongo/collection.html#pymongo.collection.Collection.find_one) method to get a document.
199199
200200
:::code language="python" source="~/azure-cosmos-db-mongodb-python-getting-started/001-quickstart/run.py" id="read_doc":::
201201
202-
In Azure Cosmos DB, you can perform a less-expensive [point read](https://devblogs.microsoft.com/cosmosdb/point-reads-versus-queries/) operation by using both the unique identifier (`_id`) and a partition key. In this code quickstart, you could use `category`.
202+
In Azure Cosmos DB, you can perform a less-expensive [point read](https://devblogs.microsoft.com/cosmosdb/point-reads-versus-queries/) operation by using both the unique identifier (`_id`) and a partition key.
203203
204204
### Query documents
205205
@@ -213,7 +213,7 @@ Troubleshooting:
213213
214214
## Run the code
215215
216-
This app creates an API for MongoDB database and collection and creates a document and then reads the exact same document back. Finally, the example issues a query that should only return that single doc. With each step, the example outputs information to the console about the steps it has performed.
216+
This app creates an API for MongoDB database and collection and creates a document and then reads the exact same document back. Finally, the example issues a query that returns documents that match a specified product *category*. With each step, the example outputs information to the console about the steps it has performed.
217217
218218
To run the app, use a terminal to navigate to the application directory and run the application.
219219

0 commit comments

Comments
 (0)