Database
[{"_id":ObjectId("6234342df8afb4001e279ecc"),"is_deleted":false,"labels":[{"_id":ObjectId("623d687e745109001e09f146"),"labelId":ObjectId("623d6821745109001e09f04e"),"xmin":0.400763358778626,"xmax":0.614503816793893,"ymin":0.694300518134715,"ymax":0.906735751295337}],"img_name":"6910486605301182464.jpg","img_originalname":"images (11).jpg","img_desc":"Cyber Sercurity multi upload","img_uri":"http://localhost:8080/resources/images/2022/3/18/6910486605301182464.jpg","img_path":"/resources/images/2022/3/18/6910486605301182464.jpg","datasetId":ObjectId("6234342df8afb4001e279eca"),"createdAt":ISODate("2022-03-18T07:26:37.422Z"),"updatedAt":ISODate("2022-03-25T07:00:14.074Z"),"__v":0}]
Query
db.collection.update({"img_uri":{$regex:"^http://localhost:8080"}},[{$set:{"img_uri":{$concat:["https://example.com",{$substrBytes:["$img_uri",{$strLenBytes:"http://localhost:8080"},{$strLenBytes:"$img_uri"}]}]}}}],{multi:true})