title: How can I replace all elements in an array with a prefix string?
body: <p>In my MongoDB collection, I have list of accounts, with role for each account, the structure has format as following</p>
  
  <pre><code>{
      "_id" : "acc1",
      "email" : "acc1@email.com",
      "password" : "password",
      "roles" : [ 
          "ADMIN", 
          "USER"
      ],
  },
  {
      "_id" : "acc2",
      "email" : "acc2@email.com",
      "password" : "password",
      "roles" : [ 
          "USER"
      ],
  },
  {
      "_id" : "acc2",
      "email" : "acc2@email.com",
      "password" : "password",
      "roles" : [ 
          "ADMIN",
          "SYSTEM",
          "USER",
      ],
  }
  </code></pre>
  
  <p>Now, all roles I would like to add the <code>ROLE_</code> as prefix, then the JSON should be</p>
  
  <pre><code>{
      "_id" : "acc2",
      "email" : "acc2@email.com",
      "password" : "password",
      "roles" : [ 
          "ROLE_ADMIN",
          "ROLE_SYSTEM",
          "ROLE_USER",
      ]
  }
  </code></pre>
  
  <p>I don't know how to implement the MongoDB script to transform for whole documents, to append the prefix to an element like that.</p>