diff --git a/lib/models/model.js b/lib/models/model.js index 99d899b4..6694ac55 100644 --- a/lib/models/model.js +++ b/lib/models/model.js @@ -503,6 +503,13 @@ Model.scopeRemoting = function(scopeName, scope, define) { http: {verb: 'delete', path: '/' + pathName}, description: 'Deletes all ' + scopeName + ' of this model.' }); + + define('__count__' + scopeName, { + isStatic: isStatic, + http: {verb: 'get', path: '/' + pathName + '/count'}, + description: 'Counts ' + scopeName + ' of ' + this.modelName + '.', + returns: {arg: 'count', type: 'number', root: true} + }); }; Model.nestRemoting = function(relationName, options, cb) {