title: Cloudant find Query with $and and $or elements
body: <p>I'm using the following json to find results in a Cloudant</p>
  
  <p><code>{
                      "selector": {
                          "$and": [
                              {
                                  "type": {
                                      "$eq": "sensor"
                                  }
                              },
                              {
                                  "v": {
                                      "$eq": 2355
                                  }
                              },
                              {
                                  "$or": [
                                      {
                                          "p": "#401000103"
                                      },
                                      {
                                          "p": "#401000114"
                                      }
                                  ]
                              },
                              {
                                  "t_max": {
                                      "$gte": 1459554894
                                  }
                              },
                              {
                                  "t_min": {
                                      "$lte": 1459509591
                                  }
                              }
                          ]
                      },
                      "fields": [
                          "_id",
                          "p"
                      ],
                      "limit": 200
                  }</code></p>
  
  <p>If I run this againt my cloudant database I get the following error:</p>
  
  <p><code>{
    "error": "unknown_error",
    "reason": "function_clause",
    "ref": 3379914628
  }</code></p>
  
  <p>If I remove one the $or elements I get the results for query.
  (<code>,{"p":"#401000114"}</code>)</p>
  
  <p>Also i get a result if I replace #401000114 with #401000114 I get result.
  But when I want to use both element I get the error code above.</p>
  
  <p>Can anybody tell what this error_reason: <strong>function_clause</strong> mean?</p>