Hi Su, Hong [Admin] (US) (US) •,
Welcome to Microsoft Q&A forum and thanks for using Azure Services.
As I understand, you want to migrate MongoDB to Cosmos for MongoDB, and getting with bulk-write error.
Could you please share configuration details of the Azure Cosmos Mongo DB API, provisioned/ serverless mode?
Also Azure Cosmos DB provides an automatic partitioning system that only requires a shard (or a partition key). The automatic partitioning mechanism is shared across all the Azure Cosmos DB APIs and it allows for seamless data and throughout scaling through horizontal distribution.
If using sharded collections, don't assume that your MongoDB collection shard key becomes your Azure Cosmos DB container partition key. Don't assume that your existing MongoDB data model document structure should be the same model you employ on Azure Cosmos DB.
- Shard key is the single most important setting for optimizing the scalability and performance of Azure Cosmos DB, and data modeling is the second most important. Both of these settings are immutable and can't be changed once they're set; therefore it's highly important to optimize them in the planning phase. Follow the guidance in the Immutable decisions section for more information.
Refer to https://learn.microsoft.com/en-us/azure/cosmos-db/concepts-limits#per-account-limits
and
https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/pre-migration-steps
for more details.
Thank you.