Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Template.game.helpers({
- Game: function () {
- var myGame = Games.findOne(
- {
- game_minutes: {$gt: MinutesSinceMidnightNow},
- court_id: court,
- game_date: {$gt: lastMidnight}
- },
- {
- sort: {game_minutes: 1}
- }
- ); // find
- console.log(myGame);
- console.log(myGame._id);
- return myGame;
- } // game function
- }); //template scoreboard.helpers
- Exception in template helper: TypeError: Cannot read property '_id' of undefined
- next_game = Games.find(
- {
- game_minutes: {$gt: timenow}
- },
- {
- sort: {game_minutes: 1},
- limit: 1
- });
- new_games = games.fetch().filter(function(game){
- return game.game_minutes > timenow;
- });
- next_game = _.min(new_games, function(game){
- return game.game_minutes;
- });
- game = Games.findOne({game_minutes: {$gt: timenow}, [ANY OTHER FILTER]}, {sort: {game_minutes: 1}});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement