I am dealing with a nested schema in my mongoDB collection. Here's an example of how it looks:
{
"_id":"61d99bf5544f4822bd963bda0a9c213b",
"execution": {
"test_split":0,
"artifacts":{
"9ed39_output": {
"uri": "http://100.com/somefile"
},
"8d777_output":{
"uri": "http://100.com/anotherfile"
}
}
}
}
Each key under "artifacts" is unique. I am looking to replace the IP address stored in the uri field (in this case, "100") with another IP address (let's say "200"). I need to implement a solution using find
and foreach
. However, I am finding it challenging due to the variable keys under "artifacts". Any guidance on how to achieve this would be greatly appreciated. Thank you.
This database is integrated with ClearML. There is a method for updating model locations as shown here: . I have attempted to adapt this approach to my current scenario, but haven't been successful yet.