Skip to content

Instantly share code, notes, and snippets.

@nicholasess
Created February 18, 2015 14:41
Show Gist options
  • Save nicholasess/65edf7c2abe5c5b4c757 to your computer and use it in GitHub Desktop.
Save nicholasess/65edf7c2abe5c5b4c757 to your computer and use it in GitHub Desktop.
Incremetion mongoose statics
ItemSchema.statics.getTotalItem = function(empresa, callback){
this.find().count(function(err, result){
if(err){
callback(err, null);
}else{
callback(null, result);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment