MongoDB Backup File Sizes

When using mongodump, is there a way to set the size for the backup files so they will not exceed a certain size?

Hi @malcolm550 welcome to the community!

No there isn’t. A dump is basically a copy of the data you have in your database, either the whole database, or specific namespaces. I’m not sure what the benefit you could gain by artificially limiting the size of the dump. Having said that, what is your use case to limit the dump size? Is there a specific reason why you want this?

If you’re concerned about the size of the dump, you can use --query to dump select documents, or use --gzip to compress it. See mongodump for more options.

Best regards

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.