Skip to Main Content

MongoByte MongoDB Logo

Welcome to the new MongoDB Feedback Portal!

{Improvement: "Your idea"}
We’ve upgraded our system to better capture and act on your feedback.
Your feedback is meaningful and helps us build better products.

Status Submitted
Categories Database
Created by Guest
Created on Feb 9, 2022

Add regex support in pipeline operator `replaceAll`

It would be very nice to have something like this possible: ``` { $replaceAll: { input: "$text", find: "/[;,.]/g", replacement: "." } } ``` Many thanks !
  • Attach files
  • Guest
    Feb 9, 2022
    Otherwise, it is big pain to $match all documents containing a "string" with a $regex, replaceAll, combine with other documents not matching, then continue with the aggregation... I might be wrong, please tell if it could be achieved easily otherwise.