mongodump --port 27019 --db pms --collection purchase --query "{ \"dt\":{ \"$gte\": { \"$date\": \"2020-02-14T04:07:34Z\" } } }" --out D:\backup_export\admin\admin --gzip
Please note that:
D:\backup_export\admin\admin
should be a directory.--gzip
is an option you can usedt
is the name of thefield
in thepurchase
collection in thepms
database
Make sure there is data in your collection by running this query from Mongo Shell; and these documents will be exported:
db.purchase.find( { dt: { $gte: ISODate("2020-02-14T04:07:34Z") } } )
For more details on mongodump
see the documentation.