update更新时,如何引用其他字段的值?
const totalWeight = 10000;
// 数据库中有如下记录:
{
"_id": "6d9dd8625e0eb4c9012e8b1f7a865b86",
"sign_ok": true,
"times": 2.0200103e+07,
"weight": 0.44591564532418015,
"tick": 0
}
现在要更新这条记录,将tick更新为 weight * totalWeight的值,如何做到?