await model.photo.update({
_id: {
$in: photoIdsParam
}
}, {
$addToSet: {
customerIds: {
code: custCode,
isDel: 'true'
}
}
}, {
upsert: true
})
mongoose根据_id更新,且如果数组中没有元素就添加
猜你喜欢
转载自www.cnblogs.com/qiyc/p/9174608.html
今日推荐
周排行