以下仅仅为自己用过的,做一下标记
db.IP_Base.updateMany(
{"Cache.cache_time" : {$gt: 0}},
[
{ $set: { cache_time: "$Cache.is_cache_time" } },
{ $unset: [ "Cache" ] }
]
)
db.IP_Base.updateMany(
{ },
{ $set: { "cache_time:" : NumberInt(1641789918)} }
);
db.IP_Base.updateMany(
{ },
[
{ $unset: [ "cache_time" ] }
]
)
db.ICP.updateMany(
{},
[
{ $set: { "cache_time":"$cache" } },
{ $unset: [ "cache"] }
]
)