How does mongodb implement replace usage in mysql

  mongodb, question

For example: mysql:
UPDATE tb1 SET f1=REPLACE(f1, ‘abc’, ‘def’);
So how to achieve similar usage under mongodb? It is to replace the string for the value of a key in the collection.

Custom func, very convenient

Visually, you want to do batch operations, mapreduce