title: MongoDb add property and move items from other
body: <p>I have an object like this</p>
  
  <pre><code>{
  name : "test"
  data : [{"itemcode":"a1"},{"itemcode":"a2"}]
  }
  </code></pre>
  
  <p>I need to change to </p>
  
  <pre><code>{
  name : "test"
  shops :[ 
    { "shopid" : 1,
      "data" : [{"itemcode":"a1"},{"itemcode":"a2"}]
  }]
  }
  </code></pre>
  
  <p>I try to update but I can not copy the array it still ramain empty. To update I use</p>
  
  <pre><code>db.getCollection("shop").find({}).forEach(function(doc){
  var a = doc.data;
  var s = [{
      "shopid":NumberInt(1),
      "data": a}]
  
  db.collection.save(doc);
  });
  </code></pre>