Add header with total number of matched items
See original GitHub issueHi,
I’m writing a small app retrieving data from your API, using skip
& limit
, and displaying data in a paginated table.
Suppose that I want only the flight_id
field for the launches
endpoint, with 10 items per page. To know how many pages are available, I must do one of the following:
- Either fetch the whole set with
filter=flight_id
&limit=999
, but it is heavy and I prefer load data lazilly - Or do 2 requests:
- one to fetch my data, with
skip=0
,limit=10
&filter=flight_id
- and the other with
limit=999
&filter=a_non_existent_field
, to get only empty objects: lighter for both you and me.
- one to fetch my data, with
I am currently using the 2nd solution. But it would be great:
- either to have a query string parameter to ask only for the result count, to simplify & lighten the 2nd request
- or to add a header or something in a normal API response with the total number of items.
The 2nd solution would be the best, IMO. Moreover, this information could be cached if no select query is present in the request.
What do you think about it ?
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
Use the Column Header to Retrieve Values from an Excel Table
MATCH will look for our report column header, such as Amount, in the ... This formula uses the SUMIFS function to add a...
Read more >Add page numbers to a header or footer in Word
Add page numbers to a header or footer. Click or tap in the header or footer where you want the page numbers to...
Read more >Matching Column Headers in a Sheets Query - YouTube
Columns can shift around in Sheets all the time - let's not let that break our queries.Using the MATCH function, we'll make sure...
Read more >Sum matching columns - Excel formula - Exceljet
To sum values in columns by matching matching column headers, you can use a formula based on the SUMPRODUCT function. In the example...
Read more >How to count total items in a column, if header name is provided
=SUM((OFFSET(B3,1,MATCH(D16,B3:J3,0)-1,10,1)<>"")*1). to be executed with Ctrl + Shift + Enter . The height set in this formula is 10 .
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
@GerkinDev new redis caching is merged and live, should be good to go on this issue 👍
In addition to the new header, I also made slight changes to the caching header shown when the response is served from cache.
spacex-api-cache
is the new header, with potential values ofHIT
orMISS
Yeeeeah that was quick! Thanks so much! 🍻