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