【问题标题】:Mongoose - updateMany猫鼬 - updateMany
【发布时间】:2020-03-03 00:48:08
【问题描述】:

updateMany 会处理标准中的这两个属性,还是只处理工作字段?

let criteria = {
    job: job._id,
    user: {$in: applicantIds}
}

let updatableObject = {
    interviewInvitation: true
}

await UserJob.updateMany(criteria, {$set: updatableObject})

【问题讨论】:

    标签: node.js mongodb mongoose


    【解决方案1】:

    过滤条件用作 AND。必须满足所有条件。

    【讨论】:

      猜你喜欢
      • 2019-05-02
      • 2017-09-09
      • 2019-09-16
      • 2017-10-08
      • 2020-04-24
      • 2012-02-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多