Created
February 18, 2015 14:41
-
-
Save nicholasess/65edf7c2abe5c5b4c757 to your computer and use it in GitHub Desktop.
Incremetion mongoose statics
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
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