title: index and query items in an array with mango query for cloudant and couchdb 2.0
body: <p>I have the following db structure:</p>
  
  <pre><code>{"_id": "0096874","genre": ["Adventure","Comedy", "Sci-Fi" ]}
  {"_id": "0099088","genre": ["Comedy", "Sci-Fi", "Western"]}
  </code></pre>
  
  <p>and like to query it like I could do in mongodb</p>
  
  <pre><code>db.movies.find({genre: {$in: ["Comedy"]}})
  </code></pre>
  
  <p>It works when i use a text index for the whole database, but that seems very wasteful:</p>
  
  <pre><code>// index
      {
        "index": {},
        "type": "text"
      }
  //query
  {
    "selector": {
      "genre": {
        "$in": ["Comedy"]
      }
    },
    "fields": [
      "_id",
      "genre"
    ]
  }
  </code></pre>
  
  <p>The following index does not work:</p>
  
  <pre><code>{
    "index": {
      "fields": [
        "genre"
      ]
    },
    "type": "json"
  }
  </code></pre>
  
  <p>What is the correct index for cloudant query, which does not index the whole db?
  Thanks for your help</p>