title: MongoDB Mongoid delete value from array
body: <p>I have mongodb document like this and want to remove one element form unpublished array 
  which is in resource_well</p>
  
  <pre><code>{
         "_id": ObjectId("4fa77c808d0a6c287d00000a"),       
         "production_status": "Unscheduled",
         "projected_air_date": null,
         "published": false,
         "resource_well": {
           "published": [
  
          ],
           "unpublished": {
             "0": ObjectId("4fa795038d0a6c327e00000e"),
             "1": ObjectId("4fa795318d0a6c327e00000f"),
             "2": ObjectId("4fa795508d0a6c327e000011"),
             "3": ObjectId("4fa796f48d0a6c327e000013")
          }
        },
         "segment_status": "Draft",
  }
  </code></pre>
  
  <p>Code in controller  </p>
  
  <pre><code>segment = Segment.find(params[:segment_id])
  # segment.resource_well[params['resource_well_type']].class =&gt; Array   
  # segment.resource_well[params['resource_well_type']].inspect =&gt; [BSON::ObjectId('4fa795038d0a6c327e00000e'), BSON::ObjectId('4fa795318d0a6c327e00000f'), BSON::ObjectId('4fa795508d0a6c327e000011'), BSON::ObjectId('4fa796f48d0a6c327e000013')]  
  segment.resource_well[params['resource_well_type']].delete(params[:asset_ids])
  segment.save
  </code></pre>
  
  <p>Not able remove an element form array</p>