1

I have a collection contains large amount of documents like this

{
    "_id" : ObjectId("5cd5885daslfjslkajfk1"),
    "album" : [ 
        "album:ASDASDA2", 
        "album:YXSFDFDS", 
        "ZXCVZXCV", 
        "DSFGSDFG"
    ]
}
{
    "_id" : ObjectId("5ce2ffsdafsdfsdfffsd"),
    "album" : [ 
        "album:1C85gNlh", 
        "album:SfA7HnpW"
    ]
}

I want to replace album: by empty in strings inside album array, How can i do this in an efficient way using mongodb?

Zeyad Etman
  • 2,250
  • 5
  • 25
  • 42
  • 1
    Does this answer your question? [Find and Replace Strings in Documents Efficiently](https://stackoverflow.com/questions/28866930/find-and-replace-strings-in-documents-efficiently) – Apoorva Chikara May 05 '21 at 05:45
  • `$replaceOne` will support from mongodb 4.4, you should refer this question's answers. – turivishal May 05 '21 at 06:18

0 Answers0