Skip to content

Commit 89636b6

Browse files
committed
Final copy edit
1 parent db86f7d commit 89636b6

28 files changed

+310
-319
lines changed

articles/cosmos-db/mongodb/how-to-dotnet-get-started.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,16 @@ This article shows you how to connect to Azure Cosmos DB for MongoDB using .NET
2222
2323
[API for MongoDB reference documentation](https://docs.mongodb.com/drivers/csharp) | [MongoDB Package (NuGet)](https://www.nuget.org/packages/MongoDB.Driver)
2424

25-
2625
## Prerequisites
2726

28-
* An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free).
29-
* [.NET 6.0](https://dotnet.microsoft.com/en-us/download)
30-
* [Azure Command-Line Interface (CLI)](/cli/azure/) or [Azure PowerShell](/powershell/azure/)
31-
* [Azure Cosmos DB for MongoDB resource](quickstart-dotnet.md#create-an-azure-cosmos-db-account)
27+
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free).
28+
- [.NET 6.0](https://dotnet.microsoft.com/download)
29+
- [Azure Command-Line Interface (CLI)](/cli/azure/) or [Azure PowerShell](/powershell/azure/)
30+
- [Azure Cosmos DB for MongoDB resource](quickstart-dotnet.md#create-an-azure-cosmos-db-account)
3231

3332
## Create a new .NET Core app
3433

35-
1. Create a new .NET Core application in an empty folder using your preferred terminal. For this scenario you'll use a console application. Use the [``dotnet new``](/dotnet/core/tools/dotnet-new) command to create and name the console app.
34+
1. Create a new .NET Core application in an empty folder using your preferred terminal. For this scenario, you'll use a console application. Use the [``dotnet new``](/dotnet/core/tools/dotnet-new) command to create and name the console app.
3635

3736
```console
3837
dotnet new console -o app
@@ -115,10 +114,10 @@ The following guides show you how to use each of these classes to build your app
115114

116115
**Guide**:
117116

118-
* [Manage databases](how-to-dotnet-manage-databases.md)
119-
* [Manage collections](how-to-dotnet-manage-collections.md)
120-
* [Manage documents](how-to-dotnet-manage-documents.md)
121-
* [Use queries to find documents](how-to-dotnet-manage-queries.md)
117+
- [Manage databases](how-to-dotnet-manage-databases.md)
118+
- [Manage collections](how-to-dotnet-manage-collections.md)
119+
- [Manage documents](how-to-dotnet-manage-documents.md)
120+
- [Use queries to find documents](how-to-dotnet-manage-queries.md)
122121

123122
## See also
124123

@@ -127,7 +126,7 @@ The following guides show you how to use each of these classes to build your app
127126

128127
## Next steps
129128

130-
Now that you've connected to a API for MongoDB account, use the next guide to create and manage databases.
129+
Now that you've connected to an API for MongoDB account, use the next guide to create and manage databases.
131130

132131
> [!div class="nextstepaction"]
133132
> [Create a database in Azure Cosmos DB for MongoDB using .NET](how-to-dotnet-manage-databases.md)

articles/cosmos-db/mongodb/how-to-dotnet-manage-collections.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,31 +28,31 @@ In Azure Cosmos DB, a collection is analogous to a table in a relational databas
2828

2929
Here are some quick rules when naming a collection:
3030

31-
* Keep collection names between 3 and 63 characters long
32-
* Collection names can only contain lowercase letters, numbers, or the dash (-) character.
33-
* Container names must start with a lowercase letter or number.
31+
- Keep collection names between 3 and 63 characters long
32+
- Collection names can only contain lowercase letters, numbers, or the dash (-) character.
33+
- Container names must start with a lowercase letter or number.
3434

3535
## Get collection instance
3636

3737
Use an instance of the **Collection** class to access the collection on the server.
3838

39-
* [MongoClient.Database.Collection](https://mongodb.github.io/node-mongodb-native/4.7/classes/Collection.html)
39+
- [MongoClient.Database.Collection](https://mongodb.github.io/node-mongodb-native/4.7/classes/Collection.html)
4040

4141
The following code snippets assume you've already created your [client connection](how-to-dotnet-get-started.md#create-mongoclient-with-connection-string).
4242

4343
## Create a collection
4444

4545
To create a collection, insert a document into the collection.
4646

47-
* [MongoClient.Database.Collection](https://mongodb.github.io/node-mongodb-native/4.5/classes/Db.html#collection)
48-
* [MongoClient.Database.Collection.InsertOne](https://mongodb.github.io/node-mongodb-native/4.7/classes/Collection.html#insertOne)
49-
* [MongoClient.Database.Collection.InsertMany](https://mongodb.github.io/node-mongodb-native/4.7/classes/Collection.html#insertMany)
47+
- [MongoClient.Database.Collection](https://mongodb.github.io/node-mongodb-native/4.5/classes/Db.html#collection)
48+
- [MongoClient.Database.Collection.InsertOne](https://mongodb.github.io/node-mongodb-native/4.7/classes/Collection.html#insertOne)
49+
- [MongoClient.Database.Collection.InsertMany](https://mongodb.github.io/node-mongodb-native/4.7/classes/Collection.html#insertMany)
5050

5151
:::code language="csharp" source="~/azure-cosmos-mongodb-dotnet/110-manage-collections/program.cs" id="create_collection":::
5252

5353
## Drop a collection
5454

55-
* [MongoClient.Db.dropCollection](https://mongodb.github.io/node-mongodb-native/4.7/classes/Db.html#dropCollection)
55+
- [MongoClient.Db.dropCollection](https://mongodb.github.io/node-mongodb-native/4.7/classes/Db.html#dropCollection)
5656

5757
Drop the collection from the database to remove it permanently. However, the next insert or update operation that accesses the collection will create a new collection with that name.
5858

@@ -62,11 +62,10 @@ Drop the collection from the database to remove it permanently. However, the nex
6262

6363
An index is used by the MongoDB query engine to improve performance to database queries.
6464

65-
* [MongoClient.Database.Collection.indexes](https://mongodb.github.io/node-mongodb-native/4.7/classes/Collection.html#indexes)
65+
- [MongoClient.Database.Collection.indexes](https://mongodb.github.io/node-mongodb-native/4.7/classes/Collection.html#indexes)
6666

6767
:::code language="csharp" source="~/azure-cosmos-mongodb-dotnet/110-manage-collections/program.cs" id="get_indexes":::
6868

69-
7069
## See also
7170

7271
- [Get started with Azure Cosmos DB for MongoDB and .NET](how-to-dotnet-get-started.md)

articles/cosmos-db/mongodb/how-to-dotnet-manage-databases.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ In Azure Cosmos DB, a database is analogous to a namespace. When you create a da
2828

2929
Here are some quick rules when naming a database:
3030

31-
* Keep database names between 3 and 63 characters long
32-
* Database names can only contain lowercase letters, numbers, or the dash (-) character.
33-
* Database names must start with a lowercase letter or number.
31+
- Keep database names between 3 and 63 characters long
32+
- Database names can only contain lowercase letters, numbers, or the dash (-) character.
33+
- Database names must start with a lowercase letter or number.
3434

3535
Once created, the URI for a database is in this format:
3636

@@ -40,26 +40,26 @@ Once created, the URI for a database is in this format:
4040

4141
You can use the `MongoClient` to get an instance of a database, or create one if it doesn't exist already. The `MongoDatabase` class provides access to collections and their documents.
4242

43-
* [MongoClient](https://mongodb.github.io/mongo-csharp-driver/2.16/apidocs/html/T_MongoDB_Driver_MongoClient.htm)
44-
* [MongoClient.Database](https://mongodb.github.io/mongo-csharp-driver/2.16/apidocs/html/T_MongoDB_Driver_MongoDatabase.htm)
43+
- [MongoClient](https://mongodb.github.io/mongo-csharp-driver/2.16/apidocs/html/T_MongoDB_Driver_MongoClient.htm)
44+
- [MongoClient.Database](https://mongodb.github.io/mongo-csharp-driver/2.16/apidocs/html/T_MongoDB_Driver_MongoDatabase.htm)
4545

46-
The following code snippet creates a new database by inserting a document into a collection. Remember, the database will not be created until it is needed for this type of operation.
46+
The following code snippet creates a new database by inserting a document into a collection. Remember, the database won't be created until it's needed for this type of operation.
4747

4848
:::code language="csharp" source="~/azure-cosmos-mongodb-dotnet/105-manage-databases/program.cs" id="create_database":::
4949

5050
## Get an existing database
5151

5252
You can also retrieve an existing database by name using the `GetDatabase` method to access its collections and documents.
5353

54-
* [MongoClient.GetDatabase](https://mongodb.github.io/mongo-csharp-driver/2.17/apidocs/html/M_MongoDB_Driver_MongoClient_GetDatabase.htm)
54+
- [MongoClient.GetDatabase](https://mongodb.github.io/mongo-csharp-driver/2.17/apidocs/html/M_MongoDB_Driver_MongoClient_GetDatabase.htm)
5555

5656
:::code language="csharp" source="~/azure-cosmos-mongodb-dotnet/105-manage-databases/program.cs" id="get_database":::
5757

5858
## Get a list of all databases
5959

6060
You can retrieve a list of all the databases on the server using the `MongoClient`.
6161

62-
* [MongoClient.Database.ListDatabaseNames](https://mongodb.github.io/mongo-csharp-driver/2.17/apidocs/html/M_MongoDB_Driver_MongoClient_ListDatabaseNames_3.htm)
62+
- [MongoClient.Database.ListDatabaseNames](https://mongodb.github.io/mongo-csharp-driver/2.17/apidocs/html/M_MongoDB_Driver_MongoClient_ListDatabaseNames_3.htm)
6363

6464
:::code language="csharp" source="~/azure-cosmos-mongodb-dotnet/105-manage-databases/program.cs" id="get_all_databases":::
6565

@@ -69,9 +69,9 @@ This technique can then be used to check if a database already exists.
6969

7070
## Drop a database
7171

72-
A database is removed from the server using the `DropDatabase` method on the DB class.
72+
A database is removed from the server using the `DropDatabase` method on the DB class.
7373

74-
* [MongoClient.DropDatabase](https://mongodb.github.io/mongo-csharp-driver/2.17/apidocs/html/M_MongoDB_Driver_MongoClient_DropDatabase_1.htm)
74+
- [MongoClient.DropDatabase](https://mongodb.github.io/mongo-csharp-driver/2.17/apidocs/html/M_MongoDB_Driver_MongoClient_DropDatabase_1.htm)
7575

7676
:::code language="csharp" source="~/azure-cosmos-mongodb-dotnet/105-manage-databases/program.cs" id="drop_database":::
7777

articles/cosmos-db/mongodb/how-to-dotnet-manage-documents.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,42 +26,46 @@ Manage your MongoDB documents with the ability to insert, update, and delete doc
2626

2727
Insert one or many documents, defined with a JSON schema, into your collection.
2828

29-
* [MongoClient.Database.Collection.InsertOne](https://mongodb.github.io/mongo-csharp-driver/2.17/apidocs/html/M_MongoDB_Driver_IMongoCollection_1_InsertOne_1.htm)
30-
* [MongoClient.Database.Collection.InsertMany](https://mongodb.github.io/mongo-csharp-driver/2.17/apidocs/html/M_MongoDB_Driver_IMongoCollection_1_InsertMany_1.htm)
29+
- [MongoClient.Database.Collection.InsertOne](https://mongodb.github.io/mongo-csharp-driver/2.17/apidocs/html/M_MongoDB_Driver_IMongoCollection_1_InsertOne_1.htm)
30+
- [MongoClient.Database.Collection.InsertMany](https://mongodb.github.io/mongo-csharp-driver/2.17/apidocs/html/M_MongoDB_Driver_IMongoCollection_1_InsertMany_1.htm)
3131

3232
:::code language="csharp" source="~/azure-cosmos-mongodb-dotnet/115-manage-documents/program.cs" id="insert_document":::
3333

3434
## Update a document
3535

36-
To update a document, specify the query filter used to find the document along with a set of properties of the document that should be updated.
36+
To update a document, specify the query filter used to find the document along with a set of properties of the document that should be updated.
3737

38-
* [MongoClient.Database.Collection.UpdateOne](https://mongodb.github.io/mongo-csharp-driver/2.17/apidocs/html/M_MongoDB_Driver_IMongoCollection_1_UpdateOne_1.htm)
39-
* [MongoClient.Database.Collection.UpdateMany](https://mongodb.github.io/mongo-csharp-driver/2.17/apidocs/html/M_MongoDB_Driver_IMongoCollection_1_UpdateMany_1.htm)
38+
- [MongoClient.Database.Collection.UpdateOne](https://mongodb.github.io/mongo-csharp-driver/2.17/apidocs/html/M_MongoDB_Driver_IMongoCollection_1_UpdateOne_1.htm)
39+
- [MongoClient.Database.Collection.UpdateMany](https://mongodb.github.io/mongo-csharp-driver/2.17/apidocs/html/M_MongoDB_Driver_IMongoCollection_1_UpdateMany_1.htm)
4040

4141
:::code language="csharp" source="~/azure-cosmos-mongodb-dotnet/115-manage-documents/program.cs" id="update_document":::
4242

4343
## Bulk updates to a collection
4444

45-
You can perform several different types of operations at once with the **bulkWrite** operation. Learn more about how to [optimize bulk writes for Azure Cosmos DB](optimize-write-performance.md#tune-for-the-optimal-batch-size-and-thread-count).
45+
You can perform several different types of operations at once with the **bulkWrite** operation. Learn more about how to [optimize bulk writes for Azure Cosmos DB](optimize-write-performance.md#tune-for-the-optimal-batch-size-and-thread-count).
4646

4747
The following bulk operations are available:
4848

49-
* [MongoClient.Database.Collection.BulkWrite](https://mongodb.github.io/mongo-csharp-driver/2.17/apidocs/html/M_MongoDB_Driver_IMongoCollection_1_BulkWrite_1.htm)
49+
- [MongoClient.Database.Collection.BulkWrite](https://mongodb.github.io/mongo-csharp-driver/2.17/apidocs/html/M_MongoDB_Driver_IMongoCollection_1_BulkWrite_1.htm)
5050

51-
* insertOne
52-
* updateOne
53-
* updateMany
54-
* deleteOne
55-
* deleteMany
51+
- insertOne
52+
53+
- updateOne
54+
55+
- updateMany
56+
57+
- deleteOne
58+
59+
- deleteMany
5660

5761
:::code language="csharp" source="~/azure-cosmos-mongodb-dotnet/115-manage-documents/program.cs" id="bulk_write":::
5862

5963
## Delete a document
6064

61-
To delete documents, use a query to define how the documents are found.
65+
To delete documents, use a query to define how the documents are found.
6266

63-
* [MongoClient.Database.Collection.DeleteOne](https://mongodb.github.io/mongo-csharp-driver/2.17/apidocs/html/M_MongoDB_Driver_IMongoCollection_1_DeleteOne_1.htm)
64-
* [MongoClient.Database.Collection.DeleteMany](https://mongodb.github.io/mongo-csharp-driver/2.17/apidocs/html/M_MongoDB_Driver_IMongoCollection_1_DeleteMany_1.htm)
67+
- [MongoClient.Database.Collection.DeleteOne](https://mongodb.github.io/mongo-csharp-driver/2.17/apidocs/html/M_MongoDB_Driver_IMongoCollection_1_DeleteOne_1.htm)
68+
- [MongoClient.Database.Collection.DeleteMany](https://mongodb.github.io/mongo-csharp-driver/2.17/apidocs/html/M_MongoDB_Driver_IMongoCollection_1_DeleteMany_1.htm)
6569

6670
:::code language="csharp" source="~/azure-cosmos-mongodb-dotnet/115-manage-documents/program.cs" id="delete_document":::
6771

articles/cosmos-db/mongodb/how-to-dotnet-manage-queries.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ Use queries to find documents in a collection.
2424

2525
## Query for documents
2626

27-
To find documents, use a query filter on the collection to define how the documents are found.
27+
To find documents, use a query filter on the collection to define how the documents are found.
2828

29-
* [MongoClient.Database.Collection.Find](https://www.mongodb.com/docs/manual/reference/method/db.collection.find/)
30-
* [FilterDefinition](https://mongodb.github.io/mongo-csharp-driver/2.17/apidocs/html/T_MongoDB_Driver_FilterDefinition_1.htm)
31-
* [FilterDefinitionBuilder](https://mongodb.github.io/mongo-csharp-driver/2.17/apidocs/html/T_MongoDB_Driver_FilterDefinitionBuilder_1.htm)
29+
- [MongoClient.Database.Collection.Find](https://www.mongodb.com/docs/manual/reference/method/db.collection.find/)
30+
- [FilterDefinition](https://mongodb.github.io/mongo-csharp-driver/2.17/apidocs/html/T_MongoDB_Driver_FilterDefinition_1.htm)
31+
- [FilterDefinitionBuilder](https://mongodb.github.io/mongo-csharp-driver/2.17/apidocs/html/T_MongoDB_Driver_FilterDefinitionBuilder_1.htm)
3232

3333
:::code language="csharp" source="~/azure-cosmos-mongodb-dotnet/125-manage-queries/program.cs" id="query_documents":::
3434

0 commit comments

Comments
 (0)