Skip to content

Index + Limit #2668

Closed Answered by texodus
JoshBurrell asked this question in Q&A
Jul 12, 2024 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

From the docs on this feature:

limit cannot be used in conjunction with index.

Even if they could be, it would not work as you describe - index is a primary key and adding a limit on top would just limit the number of unique primary keys the set could contain, it would not just allow Table to store duplicate indices.

There is a remove() method for selecting indices to clear, but you'd need to first query and/or track them yourself. Instead, you may try implementing a periodic (daily or whatever) try using a View + filter to move just the recent records, something like:

const cutoff = new Date();
cutoff.setDate(cutoff.getDate() - 1)
const ticks = await table.view({filter: [["lastUpdate",…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@JoshBurrell
Comment options

Answer selected by JoshBurrell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants