Unable to do mongodump or mongoexport from AWS DocumentDB instance


When i try to do mongodump, I am getting the below error: Failed: error creating intents to dump: error creating intents for database <db>: error counting <db>.<col>: Aggregation stage not supported: '$collStats'

According to https://docs.aws.amazon.com/documentdb/latest/developerguide/backup_restore-dump_restore_import_export_data.html - versions less than 100.6.1 should be fine, but still no success.

I downgraded both mongo and mongodump versions to the below ones: mongodump version: 100.4.0 mongod version v4.4.25

asked 8 months ago416 views
1 Answer

Kindly note that, the "$collStats" Stage Operator is not supported in any DocumentDB version currently. This is also mentioned in the document below[1].

[1] https://docs.aws.amazon.com/documentdb/latest/developerguide/mongo-apis.html#mongo-apis-aggregation-pipeline-stage

Having said that, currently there is no alternative for passing aggregated functions or combining outputs of two stages in aggregate query in DocDB. Please be aware, you will have to use separate queries and re-structure the same to mitigate this issue.

Going forward, you can keep an eye on AWS announcements [2], as all new releases in DocumentDB would be posted here.

[2] AWS updates: https://aws.amazon.com/about-aws/whats-new/2023/

answered 8 months ago
  • Hi Ruchi, Issue is I am not able to do mongodump or mongoexport as per the guide I have linked in the question. I am not trying to use the $collStats operator, rather mongodump/mongoexport is throwing the said error.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions