/usr/local/services/mongodb/bin/mongo 192.168.1.170:28001/livex --username test --password test123 find.js > result.txt
// find.js
db.t_push_msg.find({"tId" : "1460429998128443392","msgType" : 1},{"cTime":1,"fId":-1,"fName":1,"body.text":3}).forEach( function(c){
function tran_val(val){
if(parseInt(val)<10){
val="0" +val;
}
return val;
}
var datenew = new Date(c.cTime);
var year=datenew.getFullYear();
var month=tran_val(datenew.getMonth()+1);
var date=tran_val(datenew.getDate());
var hour=tran_val(datenew.getHours());
var minute=tran_val(datenew.getMinutes());
var second=tran_val(datenew.getSeconds());
var datestr=year+"-"+month+"-"+date+" "+hour+":"+minute+":"+second;
print(c._id," ",c.fId," ",c.fName," ",c.body.text.replace(/\n/g,"")," ",datestr);
} )