Skip to content

Instantly share code, notes, and snippets.

@phillyqueso
Created June 27, 2011 16:44
Show Gist options
  • Save phillyqueso/1049252 to your computer and use it in GitHub Desktop.
Save phillyqueso/1049252 to your computer and use it in GitHub Desktop.
mongoose query
client.on('moreLoad', function(obj) {
Posts.find({_id: { $lt: obj.data.postId } }).sort('createdDate', 1).limit(perPage).execFind(function(err, res) {
console.log(err);
console.log(res);
if (res != null) {
client.emit('loadPosts', {data: res});
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment