Answers for "mongodb replace string regex"

1

mongodb replace string regex

db.collection.updateMany(
  { name: { $regex: stringToReplace } },
  [{
    $set: { name: {
      $replaceAll: { input: "$name", find: stringToReplace, replacement: "" }
    }}
  }]
)
Posted by: Guest on June-16-2021

Code answers related to "mongodb replace string regex"

Code answers related to "Javascript"

Browse Popular Code Answers by Language