find blueprint : total count of records
See original GitHub issueHello,
When I do a find request with the blueprint like :
/v1/videos?limit=200
I don’t have the count of records in the response while it is said in the doc :
First of all, it optimises select data from database based on required fields and populates only associations, that you really need to populate. It mixins metadata in the root of a response also, so you know total count of records, criteria, current page, etc…
The response :
{
"code": "OK",
"message": "Operation is successfully executed",
"data": [
{
"id": "56c7a0aeb0ac4c060c0fde32"
},
{
"id": "56c7a0c7b0ac4c060c0fde33"
},
],
"criteria": {},
"limit": 200,
"start": 0,
"end": 200,
"page": 0
}
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Finding out datatable row count? - Unreal Engine Forums
I am trying to add a percentage to the progress bar divided by the amount of rows in a data table and I...
Read more >Sails.JS - Get the count of the number of objects/rows in the ...
I explained it in this answer: Get total count in Sails JS blueprint API. You can also pass query to the count function...
Read more >IDBObjectStore.count() - Web APIs - MDN Web Docs
The count() method of the IDBObjectStore interface returns an IDBRequest object, and, ... it returns the total number of records in the store....
Read more >How to Find a Copy of the Original Blueprints for a House?
The best way to find blueprints is through the local public official's office. Most jurisdictions have an assessor's office or public records office....
Read more >How count number of records? - Tableau Community
Tableau automatically creates a 'number of records' measure (which if you look at it's calculation is just the number '1'.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@prisonier you can always override the count blueprint and add your custom logic. just copy code of this function https://github.com/ghaiklor/generator-sails-rest-api/blob/dev/generators/hook/templates/api/hooks/CountHook.js#L11 into a separate file called
count.js
(inblueprints
folder) and improve the code by addingparseCriteria
etc like here: https://github.com/ghaiklor/generator-sails-rest-api/blob/dev/generators/blueprint/templates/api/blueprints/find.js#L22@ghaiklor Thanks for your answer. With the old feature I could find the number of record for any request. It is sad that we are facing a downgrade. I guess it has been removed for performance issues ?