title: How to update a nested object in rethinkDB
body: <p>I am getting an issue while updating a nested object.sample data like this </p>
  
  <pre><code>{
    "status":{
       "draft":{
             "status":"draft",
             "rating":4
        },
       "review":{
              "status":"review",
             "rating":4
        },
       "publish":{
            "status":"publish",
             "rating":4
        }
  
      }
  }
  </code></pre>
  
  <p>In the above object some times the <strong>draft/ review/ publish</strong>  are empty objects and need to check the condition and update the <strong><em>rating</em></strong> in the object.I have tried like this but getting error.</p>
  
  <p><strong>query:</strong></p>
  
  <pre><code>     r.db('sample_db').table('table').filter({id:'xxxxxxx'})
    .update({"draft": r.row('status').map(function(data){
       return r.branch(
         data('draft').hasFields({'status':true}),
        data.merge({ "rating": 100 }),
        data
       )})
      })
  </code></pre>
  
  <p><strong>Error:</strong></p>
  
  <pre><code> {
      "deleted": 0 ,
      "errors": 1 ,
      "first_error":  "Cannot convert OBJECT to SEQUENCE" ,
      "inserted": 0 ,
      "replaced": 0 ,
      "skipped": 0 ,
      "unchanged": 0
      }
  </code></pre>
  
  <p>can any one help me to solve this query. Thanks in advance.</p>