mongodb updatemany with regex

PHOTO EMBED

Fri Jun 10 2022 16:55:57 GMT+0000 (Coordinated Universal Time)

Saved by @guillecook #mongoshell

db.resolution.updateMany(
  { attach_pdf: { $regex: /.*564\..*/ } },
  [{
    $set: { attach_pdf: {
      $replaceOne: { input: "$attach_pdf", find: "564. Luxacion de muñeca.docx", replacement: "564. Luxacion de muneca.docx" }
    }}
  }]
)
content_copyCOPY