Mongodb脚本记录

mongoexport -h 172.23.88.107 --port 27017 -d stat_terminalbase -c stat_terminalbase -f terminal_mac,detect_time,site_id,device_id,device_longti,device_lat --type=csv -o d:\123.csv


db.stat_terminalbase.find().sort({detect_time:-1}).skip(500000).limit(1).pretty() 


mongoexport -h 172.23.88.107 --port 27017 -d stat_terminalbase -c stat_terminalbase -f terminal_mac,detect_time,site_id,device_id,device_longti,device_lat -q "{'detect_time':{$gt:'1378718775'}}" --type=csv -o d:\123.csv


mongoexport -h 172.23.88.107 --port 27017 -d stat_terminalbase -c stat_terminalbase -f terminal_mac,detect_time,site_id,device_id,device_longti,device_lat -q "{'detect_time':'1478718775'}" --type=csv -o d:\123.csv


db.stat_terminalbase.ensureIndex({detect_time:-1})

192.168.2.17    37017

 

posted @ 2017-07-27 17:29  段江涛IT  阅读(239)  评论(0编辑  收藏  举报
页脚HTML代码