I am using mongodump command to dump mongodb data, but when I am restoring it using mongorestore it changes order of documents (order in which documents was inserted), What might be the issue? Is there any way by which I can preserve insertion order?
You can use "maintainInsertionOrder" to preserve the insertion order. The default is False.
--maintainInsertionOrder
Default: False
If specified, mongorestore inserts the documents in the order of their appearance in the input source, otherwise mongorestore may perform the insertions in an arbitrary order.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With