Skip to content

nicolapalavecino/sails-hook-blueprint-count

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sails-hook-blueprint-count

Adds blueprint api method to count records in database. This is useful for example in pagination when you need to calculate number of pages.

Installation

In Sails.js v0.11+ installed hooks are run automatically. Therefore, simply install the hook via npm:

npm install sails-hook-blueprint-count

Usage

GET /:model/count?where={:CRITERIA}

"where" parameter is optional. If it's used it's used in the same way like you use it in default blueprint api find method Sails.js blueprint api find method documentation.

About

Add default blueprint count route to evry model

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%