From 1620ba35084cbc84f43820edb41e914bdde2b440 Mon Sep 17 00:00:00 2001 From: Eileen Noonan Date: Mon, 21 Apr 2025 11:38:16 -0400 Subject: [PATCH] docs: make table.update() nodejs guide consistent with API documentation (#2334) The docs in the Guide here do not match the [API reference] (https://lancedb.github.io/lancedb/js/classes/Table/#updateopts) for the nodejs client. I am writing an Elixir wrapper over the typescript library (Rust forthcoming!) and confirmed in testing that the API reference is correct vs the Guide. Following the Guide docs, the error I got was: "lance error: Invalid user input: Schema error: No field named bar. Valid fields are foo. For a query of: await table.update({foo: "buzz"}, { where: "foo = 'bar'"}); Over a table with a schema of just {foo: Utf8}. ## Summary by CodeRabbit - **Documentation** - Reformatted a code snippet in the guide to enhance readability by splitting it into multiple lines for improved clarity. --- docs/src/guides/tables.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/src/guides/tables.md b/docs/src/guides/tables.md index a202d2cc..571ea52f 100644 --- a/docs/src/guides/tables.md +++ b/docs/src/guides/tables.md @@ -765,7 +765,10 @@ This can be used to update zero to all rows depending on how many rows match the ]; const tbl = await db.createTable("my_table", data) - await tbl.update({vector: [10, 10]}, { where: "x = 2"}) + await tbl.update({ + values: { vector: [10, 10] }, + where: "x = 2" + }); ``` === "vectordb (deprecated)" @@ -784,7 +787,10 @@ This can be used to update zero to all rows depending on how many rows match the ]; const tbl = await db.createTable("my_table", data) - await tbl.update({ where: "x = 2", values: {vector: [10, 10]} }) + await tbl.update({ + where: "x = 2", + values: { vector: [10, 10] } + }); ``` #### Updating using a sql query