title: Node.js - Invalid select() argument
body: <p>I am trying to create a list to show all the <code>teams</code> in my database. And I get the error <code>TypeError: Invalid select() argument. Must be a string or object.</code> Can anyone help me figure out how to solve this? I just want to use it to print a list of current teams, this list of teams can then be clicked on to edit the team name basically!</p>
  
  <p>So in my <code>Schema</code> for <code>Team</code> I have this:</p>
  
  <pre><code>Team.statics.getAllMeta = function(cb){
    var query = this.find({}, ['key', 'name'], cb);
    return query.exec(cb);
  };
  </code></pre>
  
  <p>And then in my <code>index.js</code> <code>routes</code> I have this:</p>
  
  <pre><code>var getAllMeta = function(req, res, next){
    Team.getAllMeta(function(err, teamsList){
      if(!err &amp;&amp; teamsList){
        req.teamsList = teamsList;
      }
      next(err);
    });
  };
  </code></pre>
  
  <p>So that I can then call in the <code>routes</code> my <code>team</code> page like this:</p>
  
  <pre><code>  app.get('/team', getAllMeta, function(req, res){
      util.log('Serving request for url[GET] ' + req.route.path);
      res.render('team', {'teamsList' : req.teamsList});
    });
  </code></pre>
  
  <p>Just for reference here are the other relevant parts in <code>index.js</code> from <code>routes</code></p>
  
  <pre><code>  app.get('/', function(req, res){
      logger.log('Serving request for url [GET]' + req.route.path)
      Team.getAll(function(err, allTeams){
        if(!err &amp;&amp; allTeams){
          res.render('index', {'allTeams' : allTeams});
        }else{
          util.log('Error fetching team from database : ' + err);
          res.render('error');
        }
      });
    });
  
    app.get('/show/team/:key', function(req,res){
      Team.findByKey(req.params.key, function(err, teamData){
        if(!err &amp;&amp; teamData){
          teamData = teamData[0];
            res.json({
              'retStatus' : 'success',
              'teamData' : teamData
            });
        } else {
          util.log('Error in fetchin Team by key: ' + req.params.key);
          res.json({
            'retStatus' : 'failure',
            'msg' : 'Error in fetching Team by key: ' + req.params.key
          });
        }
      });
    });
  </code></pre>