pppCodes为数组,PPPCode,expiredOn为数组元素中的字段

db.getCollection('users').findOneAndUpdate({
_id: userId,
'pppCodes.PPPCode': cardId
}, {
$set: {
'pppCodes.$.active': true,
'pppCodes.$.PPCode': customerId,
'pppCodes.$.expiredOn': new Date(new Date().getTime() + cardCodeInfo.expiredDay * 86400000),
'pppCodes.$.effectiveOn': new Date()
}
});

相关文章:

  • 2021-07-26
  • 2021-08-11
  • 2022-12-23
  • 2022-12-23
  • 2021-08-25
  • 2022-12-23
  • 2021-07-21
猜你喜欢
  • 2021-11-21
  • 2021-11-03
  • 2022-12-23
  • 2023-03-07
  • 2022-12-23
相关资源
相似解决方案