Skip to content

Commit

Permalink
Fix listPaginated example in README (#207)
Browse files Browse the repository at this point in the history
## Problem
Was reviewing the outgoing docs changes for `list` support and realized
the code examples in the README were calling `.list()` rather than
`.listPaginated()`.

## Solution
Update the README.

## Type of Change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update
- [ ] Infrastructure change (CI configs, etc)
- [X] Non-code change (docs, etc)
- [ ] None of the above: (explain here)
  • Loading branch information
austin-denoble authored Mar 6, 2024
1 parent 3d5920a commit 1c47dbe
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ jobs:
strategy:
fail-fast: false
matrix:
tsVersion:
[
tsVersion: [
'~4.1.0',
'~4.2.0',
'~4.3.0',
Expand All @@ -111,7 +110,7 @@ jobs:
'~5.0.0',
'~5.1.0',
'~5.2.0',
'latest',
# 'latest', - typebox breaks with latest TypeScript, re-enable later
]
steps:
- name: Checkout
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ of record ids, this can be used to help model hierarchical relationships between
```typescript
const pc = new Pinecone();
const index = pc.index('my-index').namespace('my-namespace');
const results = await index.list({ prefix: 'doc1' });
const results = await index.listPaginated({ prefix: 'doc1#' });
console.log(results);
// {
// vectors: [
Expand All @@ -789,7 +789,10 @@ console.log(results);
// }

// Fetch the next page of results
await index.list({ prefix: 'doc1', paginationToken: results.pagination.next });
await index.listPaginated({
prefix: 'doc1#',
paginationToken: results.pagination.next,
});
```

### Fetch records by their IDs
Expand Down
4 changes: 2 additions & 2 deletions src/data/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ export class Index<T extends RecordMetadata = RecordMetadata> {
*
* const index = pc.index('my-index').namespace('my-namespace');
*
* const results = await index.listPaginated({ prefix: 'doc1' });
* const results = await index.listPaginated({ prefix: 'doc1#' });
* console.log(results);
* // {
* // vectors: [
Expand All @@ -290,7 +290,7 @@ export class Index<T extends RecordMetadata = RecordMetadata> {
* // }
*
* // Fetch the next page of results
* await index.listPaginated({ prefix: 'doc1', paginationToken: results.pagination.next});
* await index.listPaginated({ prefix: 'doc1#', paginationToken: results.pagination.next});
* ```
*
* > ⚠️ **Note:**
Expand Down

0 comments on commit 1c47dbe

Please sign in to comment.