title: Mongoose .find with a req.params array? and res.json an array of each value and count?
body: <p>Ideally a user would be able to enter multiple tags in a search field, which are then delinienated client-side (before the .get call), to be sent over ajax with each keypress.</p>
  
  <p>Working on the server-side (testing the API with Postman), if the .get serves up the variable tags as an array of [ 'tag1', 'tag2'], <strong>can req.params.tags be an array?</strong></p>
  
  <p>If so, what would it look like for the server - right now, am only getting a response from Postman for localhost:4200/api/v1/tag/tagName .. but not for /tag/tagName1+tagName2 or /tag/tagName1&amp;tagName2</p>
  
  <p>Here's the current API:</p>
  
  <pre><code>router.route('/tag/:tags')
  
      // get the list of tags for userGenerated tags (accessed at GET http://localhost:4200/api/v1/tag/:tags)
      .get(function(req, res) {
  
          Story.count( { tags: { $in: [  req.params.tags ] } }, function (err, count) {
  
              if (err)
                  res.send(err);
  
              console.log('there is/are %d story/ies with this/these tag(s)', count);
  
              if (count &gt;= 1) {
  
                  Story.find( { tags: { $in: [  req.params.tags ] } }, 'tags', function(err, stories) {
  
                      if (err)
                          res.send(err);
  
                      res.json(stories); // something to return the count of each tag with the tag
  
                  }); // find and return tags
  
              } // if count &gt;= 1
  
              if (count &lt; 1) {
  
                  res.json({ message: count + ' results' });
  
              } // if count &lt; 1 
  
          }); // .count
  
      }); // get list of tags
  </code></pre>
  
  <p>Secondly, do I need to use .aggregate (have yet to explore this really) to then res.json an ARRAY of the tags that I can loop over to get each tagName and the count for each specific tag.</p>