mongodb can export json, csv, binary format. Export tool is mongoexport, in the / bin directory. There are some parameters derived the following:
-h: server path
--port: port number
-d: database database
-c: collection table
-f: field row
-q: query query
--csv: Export csv format, can excel csv open, mysql can import data directly csv format, data format csv conveniently switch between different databases
-o: export file name
Example:
./bin/mongoexport -d shop -c goods -f type,code,name,onclick -q '{code:/ddys00.*/}' -o goods-shop.json
./bin/mongoexport -h 192.168.31.151 -d shop -c goods -f type,code,name,onclick -q '{code:/ddys00.*/}' -o goods-shop.json
./bin/mongoexport -h 192.168.31.151 --port 27017 -d shop -c goods -f type,code,name,onclick -q '{code:/ddys00.*/}' -o goods-shop.json