Skip to content

Instantly share code, notes, and snippets.

@Nomon
Created July 15, 2011 08:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nomon/1084303 to your computer and use it in GitHub Desktop.
Save Nomon/1084303 to your computer and use it in GitHub Desktop.
Photo.static({
recent: function(days, callback){
days = days || 1
var query = this.find({
date: {
$gte: Date.now() - 1000 * 60 * 60 * 24 * days
}
}).sort(['date',-1])
query.exec(callback)
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment