Order
mongoexport --host 127.0.0.1 --port 27017 \
--username root --password 123456 \
--db demo_db --collection demo_collection \
--type json --out $PWD/result.json \
-q '{"create_time":{"$gte":{"$date":"2020-03-04T16:00:00Z"},"$lt":{"$date":"2020-03-05T16:00:00Z"}}}'
illustrate:
--host
,--port
,--username
,--password
specify the data source host, port, user name, password--db
Specify the library name--collection
Specified collection name--type
Specify the export format as JSON--out
Specify the export path-q
Specify filter criteria