News for hackers. Stuff that matters.
Re:Meteor chat app by nicklovescode on Sunday July 29, 2012 @02:39AM (#4307718)
Having used Meteor for a few weeks, I'm always impressed with how much time it is saving me.

One of the unfortunate things about Meteor at the moment is there aren't many open projects to learn from. For others trying to gain insights to best practices through this projects, here are some suggestions I may offer:

Users.find({last_seen: {$lt: (now - 60 * 1000)}}).forEach(function (user) { Users.remove(user._id); });

-> Users.remove({ last_seen: { $lt: (now - 60 * 1000) } });

and

Messages.find({date: {$gt: new Date()}}).forEach(function (message) { Messages.update(message._id, {$set: {date: new Date()}}); });

-> Messages.update({date: {$gt: new Date()}}, { $set: {+new Date() }})

Excellent work otherwise though. I'd love to see more open source projects released with Meteor if anything for others to learn from!

Re:Meteor chat app by shinta42 on Sunday July 29, 2012 @08:35AM (#4308279)
Re:Meteor chat app by zquestz on Sunday July 29, 2012 @02:48AM (#4307734)
Thanks for the suggestions, just some quick hacking over the past two nights. I will update those queries. =)