Why jsonSchema metadata not exported along with mongoexport

Mongoexport is a tool for generally just getting data out, I’m not sure it’ll do that. We use it for exporting to CSV etc for feeding to other systems or it’ll also output to JSON format.

Mongodump however, will do a lot more, i.e. rebuild indexes on restore etc.

Testing locally, I created a collection with a validator, dumped it using mongodump and restored it somewhere else, the new location had the schema validator included.

1 Like