Skip to content

Commit 7bd4e48

Browse files
authored
Merge pull request #218724 from seesharprun/cosmos-dev-guide-metadata
Cosmos DB | [BULK] Update metadata and Markdown for API for MongoDB/NoSQL/Table + .NET/JS/Python developer guides
2 parents 0ec742c + 89636b6 commit 7bd4e48

31 files changed

+369
-379
lines changed

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
---
2-
title: Get started with Azure Cosmos DB for MongoDB and .NET
2+
title: Get started with Azure Cosmos DB for MongoDB using .NET
33
description: Get started developing a .NET application that works with Azure Cosmos DB for MongoDB. This article helps you learn how to set up a project and configure access to an Azure Cosmos DB for MongoDB database.
4-
author: alexwolfmsft
5-
ms.author: alexwolf
4+
author: seesharprun
5+
ms.author: sidandrews
66
ms.service: cosmos-db
77
ms.subservice: mongodb
8-
ms.devlang: dotnet
8+
ms.devlang: csharp
99
ms.topic: how-to
1010
ms.date: 10/17/2022
11-
ms.custom: devx-track-dotnet, ignite-2022
11+
ms.custom: devx-track-dotnet, ignite-2022, devguide-csharp, cosmos-db-dev-journey
1212
---
1313

14-
# Get started with Azure Cosmos DB for MongoDB and .NET Core
14+
# Get started with Azure Cosmos DB for MongoDB using .NET
15+
1516
[!INCLUDE[MongoDB](../includes/appliesto-mongodb.md)]
1617

1718
This article shows you how to connect to Azure Cosmos DB for MongoDB using .NET Core and the relevant NuGet packages. Once connected, you can perform operations on databases, collections, and documents.
@@ -21,17 +22,16 @@ This article shows you how to connect to Azure Cosmos DB for MongoDB using .NET
2122
2223
[API for MongoDB reference documentation](https://docs.mongodb.com/drivers/csharp) | [MongoDB Package (NuGet)](https://www.nuget.org/packages/MongoDB.Driver)
2324

24-
2525
## Prerequisites
2626

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/en-us/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)
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)
3131

3232
## Create a new .NET Core app
3333

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.
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.
3535

3636
```console
3737
dotnet new console -o app
@@ -114,10 +114,10 @@ The following guides show you how to use each of these classes to build your app
114114

115115
**Guide**:
116116

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)
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)
121121

122122
## See also
123123

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

127127
## Next steps
128128

129-
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.
130130

131131
> [!div class="nextstepaction"]
132132
> [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: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
title: Create a collection in Azure Cosmos DB for MongoDB using .NET
33
description: Learn how to work with a collection in your Azure Cosmos DB for MongoDB database using the .NET SDK.
4-
author: alexwolfmsft
5-
ms.author: alexwolf
4+
author: seesharprun
5+
ms.author: sidandrews
66
ms.service: cosmos-db
77
ms.subservice: mongodb
8-
ms.devlang: dotnet
8+
ms.devlang: csharp
99
ms.topic: how-to
1010
ms.date: 07/22/2022
11-
ms.custom: devx-track-dotnet, ignite-2022
11+
ms.custom: devx-track-dotnet, ignite-2022, devguide-csharp, cosmos-db-dev-journey
1212
---
1313

1414
# Manage a collection in Azure Cosmos DB for MongoDB using .NET
@@ -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: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
title: Manage a MongoDB database using .NET
33
description: Learn how to manage your Azure Cosmos DB resource when it provides the API for MongoDB with a .NET SDK.
4-
author: alexwolfmsft
5-
ms.author: alexwolf
4+
author: seesharprun
5+
ms.author: sidandrews
66
ms.service: cosmos-db
77
ms.subservice: mongodb
8-
ms.devlang: dotnet
8+
ms.devlang: csharp
99
ms.topic: how-to
1010
ms.date: 07/22/2022
11-
ms.custom: devx-track-dotnet, ignite-2022
11+
ms.custom: devx-track-dotnet, ignite-2022, devguide-csharp, cosmos-db-dev-journey
1212
---
1313

1414
# Manage a MongoDB database using .NET
@@ -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: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
title: Create a document in Azure Cosmos DB for MongoDB using .NET
33
description: Learn how to work with a document in your Azure Cosmos DB for MongoDB database using the .NET SDK.
4-
author: alexwolfmsft
5-
ms.author: alexwolf
4+
author: seesharprun
5+
ms.author: sidandrews
66
ms.service: cosmos-db
77
ms.subservice: mongodb
8-
ms.devlang: dotnet
8+
ms.devlang: csharp
99
ms.topic: how-to
1010
ms.date: 07/22/2022
11-
ms.custom: devx-track-dotnet, ignite-2022
11+
ms.custom: devx-track-dotnet, ignite-2022, devguide-csharp, cosmos-db-dev-journey
1212
---
1313

1414
# Manage a document in Azure Cosmos DB for MongoDB using .NET
@@ -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: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
title: Query documents in Azure Cosmos DB for MongoDB using .NET
33
description: Learn how to query documents in your Azure Cosmos DB for MongoDB database using the .NET SDK.
4-
author: alexwolfmsft
5-
ms.author: alexwolf
4+
author: seesharprun
5+
ms.author: sidandrews
66
ms.service: cosmos-db
77
ms.subservice: mongodb
8-
ms.devlang: dotnet
8+
ms.devlang: csharp
99
ms.topic: how-to
1010
ms.date: 07/22/2022
11-
ms.custom: devx-track-dotnet, ignite-2022
11+
ms.custom: devx-track-dotnet, ignite-2022, devguide-csharp, cosmos-db-dev-journey
1212
---
1313

1414
# Query documents in Azure Cosmos DB for MongoDB using .NET
@@ -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)