Skip to content

Instantly share code, notes, and snippets.

@EvanZ
Created December 10, 2012 23:36
Show Gist options
  • Save EvanZ/4254345 to your computer and use it in GitHub Desktop.
Save EvanZ/4254345 to your computer and use it in GitHub Desktop.
query
exports.shots = function(req, res){
console.log(req.route.params.team);
var team = req.route.params.team;
Db.connect(mongoUri, function(err, db) {
console.log('show all shots!');
db.collection('shots', function(err, coll) {
coll.find({'for':team}).sort({'date':-1,'dist':-1}).toArray(function(err, docs) {
db.close();
res.render('shots',{shots: docs, team: team});
});
});
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment