Answer the question
In order to leave comments, you need to log in
What is the correct way to use dynamic field names in MongoDB?
Surely the question is not immediately clear.
I have the following query to change data:
db.collection(history).updateOne(
{user:req.body.user.toLowerCase()},
{$set:{<filed_name>:0}},
function (err, docs) {
if (err) {console.log(err); return false}
console.log('[docsModified: ' + docs.result.nModified + ']');
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question