updateById()

Update data by ID

User.updateById("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    {hair:{color:"blonde"}},
    (err,data) => {
        if(err) return console.log(err.message)
        console.log(data);
        //example answer
        /*
            {
                name:"John",
                age:18,
                hair: {
                    color:"blonde",
                    size:"short"
                }
            }
        */ 
    }
)

Last updated