title: How to update a document using ReactiveMongo
body: <p>I get the following list of documents back from MongoDB when I find for <code>"campaignID":"DEMO-1"</code>.</p>
  
  <pre><code>[
    {
      "_id": {
        "$oid": "56be0e8b3cf8a2d4f87ddb97"
      },
      "campaignID": "DEMO-1",
      "revision": 1,
      "action": [
        "kick",
        "punch"
      ],
  
      "transactionID": 20160212095539543
    },
    {
      "_id": {
        "$oid": "56c178215886447ea261710f"
      },
      "transactionID": 20160215000257159,
      "campaignID": "DEMO-1",
      "revision": 2,
      "action": [
        "kick"
      ],
      "transactionID": 20160212095539578
    }
  ]
  </code></pre>
  
  <p>Now, what I am trying to do here is for a given <code>campaignID</code> I need to find all its versions (revision in my case) and modify the <code>action</code> field to <code>dead</code> of type String. I read the docs and the examples they have is too simple not too helpful in my case. This is what the docs say:</p>
  
  <pre><code>val selector = BSONDocument("name" -&gt; "Jack")
  
  val modifier = BSONDocument(
    "$set" -&gt; BSONDocument(
      "lastName" -&gt; "London",
      "firstName" -&gt; "Jack"),
      "$unset" -&gt; BSONDocument(
        "name" -&gt; 1))
  
  // get a future update
  val futureUpdate = collection.update(selector, modifier)
  </code></pre>
  
  <p>I can't just follow the docs because its easy to create a new BSON document and use it to modify following the BSON structure by hardcoding the exact fields. In my case I need to find the documents first and then modify the <code>action</code> field on the fly because unlike the docs, my <code>action</code> field can have different values.</p>
  
  <p>Here's my code so far which obviously does not compile:</p>
  
  <pre><code>def updateDocument(campaignID: String) ={
      val timeout = scala.concurrent.duration.Duration(5, "seconds")
      val collection = db.collection[BSONCollection](collectionName)
      val selector = BSONDocument("action" -&gt; "dead")
      val modifier = collection.find(BSONDocument("campaignID" -&gt; campaignID)).cursor[BSONDocument]().collect[List]()
      val updatedResults = Await.result(modifier, timeout)
      val mod = BSONDocument(
        "$set" -&gt; updatedResults(0),
        "$unset" -&gt; BSONDocument(
          "action" -&gt; **&lt;???&gt;** ))
      val futureUpdate = collection.update(selector, updatedResults(0))
      futureUpdate
    }
  </code></pre>