Not able to restore indexes using mongorestore

I know this topic is old, but I think I am having a similar problem. I have been searching from a solution all over Mongo community/forums

I am running a mongodump using --gzip followed by a mongorestore but could observe that the number of indexes existing in the cosmosdb are not equal to the indexes restored by the mongorestore command. The thing is there are no errors.

Could anybody please help with your prior experience.

Appreciate your help in advance.

Hi @Swaroop_Mohanty and welcome in the MongoDB Community :muscle: !

CosmosDB is a product built by MS Azure that is faking the MongoDB APIs. MongoDB has nothing to do with it. CosmosDB isn’t the real MongoDB, it’s just trying to imitate the MongoDB API.

From my latest tests (March 4, 2021), CosmosDB is failing 66.99% of the 1239 compatibility tests that are 100% green on MongoDB Atlas.

MongoDB doesn’t support CosmosDB and there are absolutely no warranty that any of the MongoDB tools would work with a system that tries to imitate the features of MongoDB… And is apparently not very good at it…

What you are trying to do would totally work on a real MongoDB system.

More comparison details here:

Also… I would recommend that you have a serious look at the pricing difference between MongoDB Atlas and Cosmos because running the tests I mentioned above costs about 0.50$ on Atlas and more than 200$ on Cosmos…