title: Pass arguments in couchdb-nano view function
body: <p>I am using nodejs's <a href="https://www.npmjs.com/package/nano" rel="nofollow noreferrer">nano</a> npm module and couchdb to get the total number of documents based on a status message that I should be able to pass in a couchdb view.</p>
  
  <p>The view looks like the following.</p>
  
  <pre><code>{
      _id: "_design/docCount",
      views: {
        fileCountByStatus: {
          reduce: "_count",
          map:
            'function (doc) {\n  if(doc.status === "COMPLETE") {\n    emit(doc._id, 1);\n  }\n}'
        },
      },
      language: "javascript"
    }
  </code></pre>
  
  <p>I am accessing the above view using <a href="https://www.npmjs.com/package/nano#dbviewdesignname-viewname-params-callback" rel="nofollow noreferrer">nano's view</a> function. </p>
  
  <p>My question is, is there anyway I can pass the doc status using the view function instead of hardcoding it (<strong><em>COMPLETE</em></strong> in the above case)</p>