title: save / update a (Moped) BSON::Document with ruby
body: <p>I tried many ways to update an existing bson document, but it never changes in my mongodb:</p>
  
  <pre><code>col = db["collection"]
  col.insert({"ben": 1})
  doc = col.find().to_a.first
  # =&gt; {"_id"=&gt;BSON::ObjectId('556c7f1b167e70640070a4d9'), "ben"=&gt;1}
  </code></pre>
  
  <p>first attempt to update:</p>
  
  <pre><code>doc.merge!({"ben": 5, "ams": 6})
  col.find().to_a.first
  # =&gt; {"_id"=&gt;BSON::ObjectId('556c7f1b167e70640070a4d9'), "ben"=&gt;1}
  </code></pre>
  
  <p>second attempt to update:</p>
  
  <pre><code>doc.update({"ben": 5, "ams": 6})
  col.find().to_a.first
  # =&gt; {"_id"=&gt;BSON::ObjectId('556c7f1b167e70640070a4d9'), "ben"=&gt;1}
  </code></pre>
  
  <p>third attempt...</p>
  
  <pre><code>doc["ben"] = 5
  doc["ams"] = 6
  doc.save
  # NoMethodError: undefined method `save' for #&lt;BSON::Document:0x00000003f284d0&gt;
  </code></pre>
  
  <p>As you can see, none of the above works for me. I couldn't find any other suggestions by a google search. Do yo know ways to update my document? Is it possible?</p>