Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export encodeTime to allow encoding of a MAX token when querying a list #30

Merged
merged 1 commit into from
Dec 8, 2022
Merged

Export encodeTime to allow encoding of a MAX token when querying a list #30

merged 1 commit into from
Dec 8, 2022

Conversation

evanderkoogh
Copy link
Contributor

When you want to query a list of items in a Durable Object you need to create a token for the MAX value.

Such as:

const encodedNow = encodeTime(Date.now())
    const taskList = await this.storage.list<AllTasks>({
      prefix: '$$_tasks::',
      end: `$$_tasks::${encodedNow}}`,
    })

@ryan-mars ryan-mars merged commit 4005db4 into ryan-mars:main Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants