Created
April 4, 2015 05:21
-
-
Save brlafreniere/c97c77bf31cf87092ef6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function messageData () { | |
var fiveHoursAgo = unixTimestampSeconds() - 5 * 60 * 60; | |
return Messages.find({unixTimestamp: {$gte: fiveHoursAgo}}); | |
} | |
function userData () { | |
return Meteor.users.find({}, {fields: {'status.online': 1, username: 1}}); | |
} | |
if (Meteor.isServer) { | |
console.log(messageData.fetch()) // this shows me 2 results | |
Meteor.publish("userData", userData); | |
Meteor.publish("messageData", messageData); // is this working? who knoooows... | |
Meteor.startup(function () { | |
// code to run on server at startup | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment