Skip to content
This repository was archived by the owner on Jun 19, 2023. It is now read-only.

Clarify query syntax in sample #216

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/dynamodb-data-mapper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -421,12 +421,14 @@ If you wish to perform a resumable query, you can use the `.pages()` method of
the iterator returned by `query` to access the underlying paginator. The
paginator differs from the iterator in that it yields arrays of unmarshalled
records and has a `lastEvaluatedKey` property that may be provided to a new
call to `mapper.query` to resume the query later or in a separate process:
call to `mapper.query` to resume the query later or in a separate process.
Assuming you had a partition key of `id` and a sort key of `orderRank`, you
could query `id='1234567890ab'` and `orderRank` between 0-10 like so:

```typescript
const paginator = mapper.query(
MyClass,
{partitionKey: 'foo', rangeKey: between(0, 10)},
{id: '1234567890ab', orderRank: between(0, 10)},
{
// automatically stop after 25 items or the entire result set has been
// fetched, whichever is smaller
Expand Down