I want to update the data of a field in the mongodb database in batches. The database is as follows. Use https://www.baidu.com
to 127.0.0.1 in the database.{
"_id" : ObjectId("5aaf69069c49ac25b89903b5"),
"title" : "127.0.0.1:8888/abs.png",
"content" : "",
"__v" : 0
}
{
"_id" : ObjectId("5aaf69b9c1110b266c2810b6"),
"title" : "127.0.0.1:8888/abs.png",
"content" : "",
"__v" : 0
}
{
"_id" : ObjectId("5aaf69fa0b92bc2538e26ced"),
"title" : "127.0.0.1:8888/abs545545.png",
"content" : "",
"__v" : 0
}
this is my
db.getCollection ("blog"). UpdateMany ({"title": {$regex: "127.0.0.1 blog"). UpdateMany (8888"}}
how should I write here? Using $set will replace all the fields. I just want to replace 127.0.0.1purl 8888)