title: MongoDB: $unset replaces with null?
body: <p>I have an array stored in my document:</p>
  
  <pre><code>    "properties" : [
              {
                      "createdate" : 1375981035,
                      "updated" : 1375981035
              },
              {
                      "accessdate" : 1375981035,
                      "updated" : 1375981035
              },
              {
                      "code" : "4ffa04fe06000000",
                      "updated" : 1375981038
              }
      ],
  </code></pre>
  
  <p>An update is performed to unset the property 'code':
  <code>db.coll.update({'properties.code':'4ffa04fe06000000'},{'$unset':{'properties.$':1}});</code></p>
  
  <p>My result is this:</p>
  
  <pre><code>    "properties" : [
              {
                      "createdate" : 1375981035,
                      "updated" : 1375981035
              },
              {
                      "accessdate" : 1375981035,
                      "updated" : 1375981035
              },
              null
      ],
  </code></pre>
  
  <p>But I expect it to be this:</p>
  
  <pre><code>    "properties" : [
              {
                      "createdate" : 1375981035,
                      "updated" : 1375981035
              },
              {
                      "accessdate" : 1375981035,
                      "updated" : 1375981035
              }
      ],
  </code></pre>
  
  <p>What is a better way to unset, without that resulting null key?
  Is '$pull' better?</p>