contentful-management.js
contentful-management.js copied to clipboard
Total items count
Hi, is there a method that will return the total items count. I'm having a problem once the total number of items in response reach the response limit. So I would need total number of items to implement paging-like behavior.
sys: { type: 'Error', id: 'BadRequest' },
message: 'Response size too big. Maximum allowed response size: 7340032B.',
requestId: 'blahblah'
}
Hey @nenadg .
It is a bit unclear what exactly request you are sending, but usually, you should be able to get the total number if you add ?limit=0 to the request. Then you will not hit the response size limit, because the response will not have any data, but also you should be able to see the total number of entities you are trying to fetch
Hi @Spring3, sorry for not reaching earlier. I'm using contentful-management, so in the end my request would look something like this:
await client.getEntries({
content_type: contentType,
/* ... what else goes here to get total items count? */
})
I've tried setting limit: 0 but that didn't yield total number of entries.
Thanks!
I have made some quick requests and I got the total number of entries without all the data for each entry.
For a specific content type:

Total amount of entries no matter the content type

Thanks, this resolves my issue.