diff --git a/js/README.md b/js/README.md index f3dd3fef890..140fa77f209 100644 --- a/js/README.md +++ b/js/README.md @@ -52,7 +52,7 @@ import { tableFromIPC } from 'apache-arrow'; const arrow = readFileSync('simple.arrow'); const table = tableFromIPC(arrow); -console.table(table.toArray()); +console.table([...table]); /* foo, bar, baz @@ -64,6 +64,20 @@ null, null, null */ ``` +The most efficient way to work with an Arrow `Table` is to access the column Vectors (which you can get with `getChild` and `getChildAt`). + +```js +table.getChildAt(0).get(0); // 1 +``` + +If you need to access the rows, you can iterate over the table and access a row proxy. + +```js +for (const row of table) { + console.log(row); +} +``` + ### Create a Table when the Arrow file is split across buffers ```js