조회수 증가 - PUT
// 변경하기 updateOne({조건}, {변경할내용})
const result = await coll.updateOne( { _id : no }, { $inc : {hit : 1} } );
console.log(result);
CMD>
{
acknowledged: true,
modifiedCount: 1,
upsertedId: null,
upsertedCount: 0,
matchedCount: 1
}
modifiedCount
사용
if(result.modifiedCount === 1){
return res.send({status:200});
}
return res.send({status:-1});