I have collection with many documents. I want to remove the special character in all the document.
My document is like as shown below. There is period in the value for all name apple , orange and banana.
{
  "_id" : ObjectId("54fdfdfdf54fdfg5474"),
  "someField" : "something",
  "SomeString" : "something",
  "SomeMoreSting" : "SomeMore",
  "fields" : [{
      "name" : "apple",
      "value" : ".200"
    }, {
      "name" : "orange",
      "value" : "431736.78"
    }, {
      "name" : "banana",
      "value" : "20.25"
    }]
}
After executing the update query, I want the document to look like below. Here period is removed in the value field for apple and orange. But period is not removed for banana. I want to remove this for specific field value but not for all the field value in this collection for all the documents. Please let me know how i can achieve this.
{
  "_id" : ObjectId("54fdfdfdf54fdfg5474"),
  "someField" : "something",
  "SomeString" : "something",
  "SomeMoreSting" : "SomeMore",
  "fields" : [{
      "name" : "apple",
      "value" : "200"
    }, {
      "name" : "orange",
      "value" : "43173678"
    }, {
      "name" : "banana",
      "value" : "20.25"
    }]
}
 
     
    