mongoexport -d test -c test -o test.dat -h 192.168.0.127 --port 27018
mongoimport -d test -c test --upsert test.dat -h 192.168.0.127 --port 27018 ( --drop)
说明:
-h:数据库宿主机的IP
-u:数据库用户名
-p:数据库密码
-d:数据库名字
-c:集合的名字
-f:导出的列名
-q:导出数据的过滤条件
--csv:导出格式为csv