title: MongoDB split string and Update
body: <p>I have document structure like this: </p>
  
  <pre><code>{
      "_id" : ObjectId("5a3a77d9d274eb44bc85d7c8"),
      "b_id" : 3,
      "b_display_tag" : "Veg Curry, Non Veg Curry"
  }
  </code></pre>
  
  <p>I am able to get the first element from the string in <code>b_display_tag</code> using split and aggregate query: </p>
  
  <pre><code>db.blogs.aggregate([
      {$project: {"b_display_tag": {$arrayElemAt:[{$split: ["$b_display_tag" , ","]}, 0]}}}
  ])
  </code></pre>
  
  <p>Result: </p>
  
  <pre><code>/* 1 */
  {
      "_id" : ObjectId("5a3a77d9d274eb44bc85d7c8"),
      "b_display_tag" : "Veg Curry"
  }
  </code></pre>
  
  <p>How can I update <code>b_display_tag</code> in the whole document with the first element from comma separated string?</p>