Reputation: 27
diseaseModel.updateMany({matched: current_matched, "$text":{"$search" : `\"${desc}\"`}}, {$inc: {matched: 1}})
I'm trying to find and update my documents that have the field "matched" that matches a variable, and text in the document that matches another variable but this doesn't work, what is the problem with this command?
Upvotes: 0
Views: 85
Reputation: 10727
Following way is working:
diseaseModel.updateMany({ matched: current_matched , "$text":{"$search" : `${desc}` }}, {$inc: {matched: 1}})
Upvotes: 1