export data 导出数据
mongoexport --host localhost --port 20000 --db dspx --collection dspx_rtb_reportdata --type=csv --out text.csv --fields adgroupName,bidType,budgetType,campaignId,campaignName,city,clkCount,clkDeductCount,clkEffectiveCount,clkOutCount,clkTrackType,connectionType,covCount,covDeductCount,covEffectiveCount,covOutCount,creativeId,deivceType,impCount,impDeductCount,impEffectiveCount,impOutCount,keyHash,keyStr,materialName,materialSpec,materialStatus,materialType,netId,netName,operatorAccount,operatorName,operatorsCosts,os,productId,productName,province,time
Problem
mongdb数据更新:cost没有转化单价
Solution
solution:
db.adx_report.find( { $and: [ {"cost":{$gt: 1000}}, {"impCount":{$lt: 100}}] }).snapshot().forEach(
function (elem) {
db.adx_report.update(
{
_id: elem._id
},
{
$set: {
"cost": elem.cost/10000000
}
}
);
}
);
db.adx_report.find({"_id" : ObjectId("5a6197a9ea2c6361750391d8")}).snapshot().forEach(
function (elem) {
db.adx_report.update(
{
_id: elem._id
},
{
$set: {
"cost": elem.cost/10000000
}
}
);
}
);
db.adx_report.find( { $and: [ {"cost":{$gt: 1000}}, {"impCount":{$lt: 100}}] }).limit(10);
网友评论