mirror of
https://github.com/lancedb/lancedb.git
synced 2026-01-05 03:12:57 +00:00
Compare commits
2 Commits
qian/saas-
...
albertlock
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8abd5c8d85 | ||
|
|
1b455dbce8 |
@@ -164,6 +164,7 @@ You can further filter the elements returned by a search using a where clause.
|
||||
const results_2 = await table
|
||||
.search(Array(1536).fill(1.2))
|
||||
.where("id != '1141'")
|
||||
.limit(2)
|
||||
.execute()
|
||||
```
|
||||
|
||||
@@ -187,6 +188,7 @@ You can select the columns returned by the query using a select clause.
|
||||
const results_3 = await table
|
||||
.search(Array(1536).fill(1.2))
|
||||
.select(["id"])
|
||||
.limit(2)
|
||||
.execute()
|
||||
```
|
||||
|
||||
|
||||
@@ -37,8 +37,10 @@ yet support Windows or musl-based Linux (such as Alpine Linux).
|
||||
|
||||
## Example code
|
||||
```javascript
|
||||
// connect to a remote DB
|
||||
const lancedb = require('vectordb');
|
||||
const { Schema, Field, Int32, FixedSizeList, Float32 } = require('apache-arrow/Arrow.node')
|
||||
|
||||
// connect to a remote DB
|
||||
const db = await lancedb.connect({
|
||||
uri: "db://your-project-name",
|
||||
apiKey: "sk_...",
|
||||
@@ -58,11 +60,11 @@ const schema = new Schema(
|
||||
new Field('price', new Float32())
|
||||
]
|
||||
)
|
||||
const table = await db.createTable(
|
||||
tableName,
|
||||
const table = await db.createTable({
|
||||
name: tableName,
|
||||
schema,
|
||||
data
|
||||
)
|
||||
}, data)
|
||||
|
||||
// list the table
|
||||
const tableNames_1 = await db.tableNames('')
|
||||
// add some data and search should be okay
|
||||
|
||||
Reference in New Issue
Block a user