In Stock Price Checker I need update two fields I cannot find the manuals of that and this my solution so far.
increment is create new on if no one is in db, upsert :true is similar for whole collection.
If I using them separatly they working. In this case only the second push.
https://specify.io/how-tos/mongodb-update-documents#UpdateFieldsMultiDocuments
var likenum = req.query.like ? 1 : 0;
db.collection("finance1").updateOne(query,
({
$inc: {
like: likenum
}
}, {
$push: {
"ip": req.ip
}
}),
{
upsert: true
},