📜  lieke==1 - 任何代码示例

📅  最后修改于: 2022-03-11 14:57:38.905000             🧑  作者: Mango

代码示例1
app.post("/index/:id", function (req, res) {
    TestData.findById(req.params.id, function (err, theUser) {
        if (err) {
            console.log(err);
        } else {
            theUser.likes += 1;
            theUser.save();
            console.log(theUser.likes);
            res.send({likeCount: theUser.likes}); //something like this...
        }
    });
});