title: Couchdb 2 _find query not using index
body: <p>I'm struggling with something that should be easy but it's making no sense to me, I have these 2 documents in a database:</p>
  
  <pre><code>{ "name": "foo", "type": "typeA" },
  { "name": "bar", "type": "typeB" }
  </code></pre>
  
  <p>And I'm posting this to _find:</p>
  
  <pre><code>{
      "selector": {
          "type": "typeA"
      },
      "sort": ["name"]
  }
  </code></pre>
  
  <p>Which works as expected but I get a warning that there's no matching index, so I've tried posting various combinations of the following to _index which makes no difference:</p>
  
  <pre><code>{
      "index": {
          "fields": ["type"]
      }
  }
  {
      "index": {
          "fields": ["name"]
      }
  }
  {
      "index": {
          "fields": ["name", "type"]
      }
  }
  </code></pre>
  
  <p>If I remove the sort by name and only index the type it works fine except it's not sorted, is this a limitation with couchdbs' mango implementation or am I missing something?</p>
  
  <p>Using a view and map function works fine but I'm curious what mango is/isn't doing here.</p>