title: How to insert to the certain position in the array in the subdocument by using Mongoose an MongoDB 2.6
body: <p>A great explanation of how to use new <code>$position</code> operator of Mongodb 2.6 by using Mongoose was given in the <a href="https://stackoverflow.com/questions/23063387/does-moongoose-3-8-8-support-position-operator?answertab=active#tab-top">answer</a> to my question. The suggested solution works perfect for simple arrays. If array is in subdocument or each element of array is array the suggested solution doesn't work. I mean something like this:</p>
  
  <pre class="lang-js prettyprint-override"><code>List.collection.update(
  {/*....*/},
  { "$push": {
      "subdocument.list": {
        "$each": [ 1, 2, 3 ],
        "$position": 0 }
      }
  },function(err,NumAffected) {
    console.log("done");
  
  });
  </code></pre>
  
  <pre class="lang-js prettyprint-override"><code>List.collection.update(
  {/*....*/},
  { "$push": {
      "list1.$.list2": {
        "$each": [ 1, 2, 3 ],
        "$position": 0 }
      }
  },function(err,NumAffected) {
    console.log("done");
  
  });
  </code></pre>