#pablo_list-totalcount

1 messages ¡ Page 1 of 1 (latest)

marsh quartzBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1278015647023890514

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

red beacon
#

pablo_list-totalcount

#

@slender forge no, that's not something we support and it's also not something we'd recommend. You could pre-fetch some pages if you want but I'd limit the pages rendered to the next five or something. I wouldn't list all the data first just to render that view (and it wouldn't be performant as you grow)

slender forge
#

exactly, i dont want to have to fetch all the data, just to count the total and sort it. does the api provide this functionality at all? is it something that could be added? cursor based pagination isn't ideal tbh

red beacon
#

We do not support anything like this, so what you are trying to do is not possible.

slender forge
#

and what about filtering? i want to pass a date range to get a subset of the data

red beacon
#

Some of our List APIs offer a created parameter that allows you to filter.

slender forge
#

for the list transactions endpoint, the created filter says it's an integer, how does that work with dates? Do you have any examples?

red beacon
#

Sorry, can you share exactly what API you are talking about so I can help you?

red beacon
#

okay so it's not an integer right? It's a hash that contains multiple possibilities based on what you are trying to do.
But each parameter inside is an integer and it would be the unix timestamp for the date you want. Our API uses unix timestamps everywhere, including on created in the API resource

#

What programming language are you using?

slender forge
#

can you combine the various operators? eg created.lt and created.gt ?

red beacon
#

yes

slender forge
#

if those filters are used, I assume it pre-sorts the entire result set, so even if i just get the first page, its sorted correctly?

#

rather than sorting after fetching the first page

red beacon
#

there's no "sort" at all no. Our List APIs always return the most recently created object first.
What the filter does is limit the window of time to look at. So yes if you pass gt and lt then it will only return Transactions created between those values with the most recently created first

slender forge
#

hmm

#

is sorting simply not on the roadmap at all?

#

(yes sorry, i understand about the filtering/sorting, got them mixed up just then)

red beacon
#

correct we have no plans to offer sorting. But you shouldn't need sorting.

slender forge
#

it's what our client wants

#

so we need to support it

red beacon
#

Sorry you say sorting again but do you mean something else? I don't really follow what you are saying unfortunately

red beacon
#

@slender forge did you have more questions?