我在 Mongo 中有以下要编辑的数据结构:
{
"images" : [{
"image_id" : 46456,
"image_path" : "http://cdn.site.com/image.jpg",
"image_thumbnail" : "http://cdn.site.com/image.jpg",
"image_detailed" : "http://cdn.site.com/image.jpg",
"image_type" : "0"
}, {
"image_id" : 46452,
"image_path" : "http://cdn.site.com/image.jpg",
"image_thumbnail" : "http://cdn.site.com/image.jpg",
"image_detailed" : "http://cdn.site.com/image.jpg",
"image_type" : "2"
}, {
"image_id" : 46453,
"image_path" : "http://cdn.site.com/image.jpg",
"image_thumbnail" : "http://cdn.site.com/image.jpg",
"image_detailed" : "http://cdn.site.com/image.jpg",
"image_type" : "0"
}, {
"image_id" : 46454,
"image_path" : "http://cdn.site.com/image.jpg",
"image_thumbnail" : "http://cdn.site.com/image.jpg",
"image_detailed" : "http://cdn.site.com/image.jpg",
"image_type" : "A"
}]
}
我想将整个数组中的所有“http”替换为“https”,无论它们在哪个字段中。
我该怎么做?
谢谢。