0

I'm trying to do a simple search and replace in mongodb ver 2.6.6.

Here is my find command: db.name.find({'level1.level2.text' : /.*http:\/\/www\.oldurl\.com\/.*/ })

and I want to replace it with https://www.newurl.com/test

I've tried looking up various methods but since ours is an older version of mongo, I can't find the correct syntax.

Nick E
  • 129
  • 1
  • 4
  • MongoDB 2.6 reached end of life in April, 2016 so it is definitely time to upgrade to a newer version. At a minimum you should upgrade to the final 2.6.12 release which doesn't include any backward-breaking changes. I marked this post as a duplicate of one which has a solution in the accepted answer, and some alternative answers for newer versions of MongoDB and different client/drivers. – Stennie Aug 17 '21 at 05:27

0 Answers0