How to deploy Azure Cosmos DB MongoDB Collection?TypeScript
azure-nativepackage contains the
MongoDBResourceMongoDBCollectionresource. An instance of it represents a MongoDB collection within a database under an Azure Cosmos DB account.
This is a representation of the properties you may assign while creating an
In the above code:
accountNamespecifies the Cosmos DB account name.
databaseNameis the name of the database in which you're creating the collection.
resourceis an object that represents the properties of the Cosmos DB MongoDB collection.
idis the name of the Cosmos DB MongoDB collection.
shardKeyis a key-value pair of shard keys to be applied for the request.
optionsis an object, where you can set the desired throughput for the collection.
collectionNameprovides a name for the MongoDB collection.
resourceGroupNameshould correspond to the resource group where the Cosmos DB account resides.
Replace the values in
<>with your actual values. For example, replace
<shardKeyName>with the name that you want to use as your shard key.
Please note that, before you can create a Cosmos DB MongoDB Collection, you should have a Cosmos DB account and a MongoDB Database created.
Check this link for more details on the
MongoDBResourceMongoDBCollectionclass: Azure Pulumi Docs