Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

mongodb replace string

db.mycollection.find({}).forEach((doc, index) => {
  doc.myStr = doc.myStr.replace('foo', 'bar');
  db.mycollection.save(doc);
});
 
PREVIOUS NEXT
Tagged: #mongodb #replace #string
ADD COMMENT
Topic
Name
6+8 =