mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 05:49:20 +08:00
refactor: 重构gmv改成交
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
// Navicat MongoDB 查询窗口可直接执行(连到正确库后,三段可依次或一起执行)
|
||||
// gmv* → deal*:bi_order_stat_daily_shop / product / sku
|
||||
|
||||
db.bi_order_stat_daily_shop.updateMany(
|
||||
{
|
||||
$or: [
|
||||
{ gmvAmount: { $exists: true } },
|
||||
{ gmvOrderCount: { $exists: true } },
|
||||
{ gmvQuantitySum: { $exists: true } }
|
||||
]
|
||||
},
|
||||
{
|
||||
$rename: {
|
||||
gmvAmount: "dealAmount",
|
||||
gmvOrderCount: "dealOrderCount",
|
||||
gmvQuantitySum: "dealQuantitySum"
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
db.bi_order_stat_daily_product.updateMany(
|
||||
{
|
||||
$or: [
|
||||
{ gmvAmount: { $exists: true } },
|
||||
{ gmvOrderCount: { $exists: true } },
|
||||
{ gmvQuantitySum: { $exists: true } }
|
||||
]
|
||||
},
|
||||
{
|
||||
$rename: {
|
||||
gmvAmount: "dealAmount",
|
||||
gmvOrderCount: "dealOrderCount",
|
||||
gmvQuantitySum: "dealQuantitySum"
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
db.bi_order_stat_daily_sku.updateMany(
|
||||
{
|
||||
$or: [
|
||||
{ gmvAmount: { $exists: true } },
|
||||
{ gmvOrderCount: { $exists: true } },
|
||||
{ gmvQuantitySum: { $exists: true } }
|
||||
]
|
||||
},
|
||||
{
|
||||
$rename: {
|
||||
gmvAmount: "dealAmount",
|
||||
gmvOrderCount: "dealOrderCount",
|
||||
gmvQuantitySum: "dealQuantitySum"
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// 可选校验(期望均为 0)
|
||||
// db.bi_order_stat_daily_shop.countDocuments({ gmvAmount: { $exists: true } })
|
||||
// db.bi_order_stat_daily_product.countDocuments({ gmvAmount: { $exists: true } })
|
||||
// db.bi_order_stat_daily_sku.countDocuments({ gmvAmount: { $exists: true } })
|
||||
Reference in New Issue
Block a user