mongo 使用 mongoexport 按照条件导出 csv 文件

cankao : https://blog.csdn.net/enjolras_fuu/article/details/96479807

mongoexport --host 127.0.0.1 --port 27017 --db ELSA_MILESTONE_SUBSCRIPTION_SERVICE --collection 'milestone_work_table' --type csv --fieldFile /opt/milestone_work_table.txt   --out /opt/milestone_work_table.csv  --limit 5

mongoexport -d test -c records -q '{ a: { $gte: 3 }, date: { $lt: { "$date": "2016-01-01T00:00:00.000Z" } } }' --fields "_id,a,b,c,date" --type=csv --out exportdir/myRecords.csv

mongoexport -d test -c records -q '{ a: { $gte: 3 }, date: { $lt: { "$date": "2016-01-01T00:00:00.000Z" } } }' --fieldFile fields.txt --type=csv --out exportdir/myRecords.csv



原文链接:https://blog.csdn.net/enjolras_fuu/article/details/96479807

 
原文地址:https://www.cnblogs.com/lshan/p/12191229.html