title: PouchDB query using parameters
body: <p>Lets suppose we store cars (about 40MB) represented as JSON objects in a PouchDB, and we would like to search, based on the horsepower attribute. example in sql: select * from cars where HP > 100. </p>
  
  <p>You can query pouchDB by key, but obviously HP is not the key of the document. Is there a way you can do this?</p>
  
  <p>As far as I understand the map function, </p>
  
  <pre><code>function(doc) {
    if(doc.value) {
      emit(doc.value, null);
    }
  }
  </code></pre>
  
  <p>it is not possible to access any variable within the outer scope of the function. </p>
  
  <pre><code>var horsePower = $scope.horsePowerInputField
  
  function(doc) {
    if(doc.hp &gt; horsePower) {
      emit(doc.value, null);
    }
  }
  </code></pre>
  
  <p>so is there a possibility to query the database, parametrized based on non-key variables?</p>