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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM