Mongoose .save函数返回“找不到ID为“ 32fdj…”版本0的匹配文档,修改路径为“ cmRooms””

    let property = await PropertyModel.findOne({
      propertyId: res.locals.userInformations.userId
    });

    let cmRooms = property.cmRooms;
    const newCmRooms = cmRooms.filter(
      cmRoom => cmRoom.cmRoomId !== "1234";
    );

    property.cmRooms = newCmRooms;
    property.save(err => {
      if (err) console.log(err);
    });

我收到以下错误

消息:“找不到与ID相匹配的文档   “ 5eb7638320ab5d0633477081”版本0已修改路径“ cmRooms”',      名称:“ VersionError”,版本:0,      modifiedPaths:['cmRooms']}
评论