I have a collection Brands, I have to replace the path ./assets/ to D:/data/db/images , I have multiple occurrences of this in multiple documents. How do I acheive this using a query ?
Sample of each document
{"name":"Dell","images":["./assets/dell1.jpg","./assets/dell2.jpeg","./assets/dell3.jpg"],
"captions":["Yours is here","Easy as dell","Uniquely you"],
"logo":"./assets/dell4.png",
"details":{"headOffice":"Bangalore","address":"No.12/1, Divyashree Green, Koramangala Inner Ring Rd, Domlur, Bengaluru - 560071",
"phoneNumber":"(080) 28077000 ","website":"www.dell.com"}
}
mongodumb(keep a copy of this before any other step), then you do some text substitution withsedand you re-inject the modified documents to your DB withmongorestore. If you are not on Linux you can forget that solution. If your collection contains more than 10000 entries you better forget it also.D:/in your path. You are on windows and my solution will not help.