From 1c47dbe0390fb43c3e5c2eb90e8bd4dc0d64cab7 Mon Sep 17 00:00:00 2001 From: Austin DeNoble Date: Wed, 6 Mar 2024 14:56:53 -0500 Subject: [PATCH] Fix listPaginated example in README (#207) ## 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) --- .github/workflows/testing.yml | 5 ++--- README.md | 7 +++++-- src/data/index.ts | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index b385733e..634c4ee3 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -97,8 +97,7 @@ jobs: strategy: fail-fast: false matrix: - tsVersion: - [ + tsVersion: [ '~4.1.0', '~4.2.0', '~4.3.0', @@ -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 diff --git a/README.md b/README.md index e7901be8..f77353b3 100644 --- a/README.md +++ b/README.md @@ -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: [ @@ -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 diff --git a/src/data/index.ts b/src/data/index.ts index 5d244dac..157cc61a 100644 --- a/src/data/index.ts +++ b/src/data/index.ts @@ -273,7 +273,7 @@ export class Index { * * 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: [ @@ -290,7 +290,7 @@ export class Index { * // } * * // 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:**