开发者

count nested array inside documen using updateOne() function

const reset_qr_list_and_update_count = await stock_read_log.updateOne(
    {
      payload: {$ne:req.body.payload},
      "qr_list.payload": req.body.new_qr_list[indexx].payload,
      company_id:req.body.company_id
    },
    {
      "$pull": {
            "qr_list": {
              payload: req.body.new_qr_list[indexx].payload
            }
          },
      $set:{
        qty: xx 
      },
    }
    );
  $set:{
        qty: model.aggreation({
//the query
}).count()
      },

after pulling one of the list above,i want to re-count list left ,how can i achieve that within this开发者_C百科 function?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜