Skip to content

Commit a45ab8d

Browse files
committed
Update docs
1 parent 422fd18 commit a45ab8d

34 files changed

Lines changed: 293 additions & 226 deletions

.changeset/eleven-crews-pull.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313

1414
**Import form label reset** (`rushdb-dashboard`): The label field in the import data page is now cleared whenever the user goes back to the method-selection step, uploads a new file, or switches to the CSV editor — preventing stale labels from persisting across import iterations.
1515

16-
**Docs updated for three surfaces** (`docs`): `indexing.md` revised to reflect that index creation no longer requires the property to already exist. `write-with-vectors.mdx` documents the flat `VectorEntry[]` overload. `semantic-search.mdx` mentions the `record.score` convenience getter.
16+
**Docs updated** (`docs`): `indexing.md` revised to reflect that index creation no longer requires the property to already exist. `write-with-vectors.mdx` and `bring-your-own-vectors.mdx` document the flat `VectorEntry[]` overload. `semantic-search.mdx` mentions the `record.score` convenience getter. TS reference docs (`RushDB.md`, `DBRecordInstance.md`) describe the flat `vectors` form and the `score` getter. Python reference docs (`RushDB.md`) mention the flat `vectors` form. All tutorial code examples (15 `.mdx` files) now prefer the `.score` getter over raw `__score` access. `manage-indexes.mdx` error reference updated to remove the stale 404 row (property no longer needs to exist). All incorrect `where: { __id: ... }` filter patterns replaced with `where: { $id: ... }` across 12 tutorial files (TS, Python, and Shell code blocks).

docs/docs/learn/reference/python/RushDB.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,24 +41,24 @@ All database operations are accessed through sub-namespaces on the client instan
4141

4242
CRUD and bulk operations on records.
4343

44-
| Method | Description |
45-
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
46-
| `create(label, data, *, options, vectors, transaction)` | Create a single record |
47-
| `create_many(label, data, *, options, vectors, transaction)` | Create multiple flat records |
48-
| `import_json(data, label, *, options, transaction)` | Import nested/complex JSON payloads; `label` may be omitted for container objects whose top-level values are objects or arrays of nested records |
49-
| `import_csv(label, data, *, options, parse_config, vectors, transaction)` | Import records from CSV text |
50-
| `upsert(data, label, *, options, vectors, transaction)` | Create or update a record |
51-
| `set(target, data, *, label, vectors, transaction)` | Replace all fields of a record |
52-
| `update(target, data, *, transaction)` | Partially update a record |
53-
| `find(search_query, *, record_id, transaction)` | Search records; returns `SearchResult` |
54-
| `find_one(search_query, *, transaction)` | Return the first match or `None` |
55-
| `find_uniq(search_query, *, transaction)` | Return the single match or `None`; raises if more than one |
56-
| `find_by_id(target, *, transaction)` | Fetch record(s) by ID |
57-
| `delete(search_query, *, transaction)` | Delete all records matching a query |
58-
| `delete_by_id(target, *, transaction)` | Delete record(s) by ID |
59-
| `attach(source, target, *, options, transaction)` | Create relationships between records |
60-
| `detach(source, target, *, options, transaction)` | Remove relationships between records |
61-
| `export(search_query, *, transaction)` | Export matching records as CSV text |
44+
| Method | Description |
45+
| ------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
46+
| `create(label, data, *, options, vectors, transaction)` | Create a single record |
47+
| `create_many(label, data, *, options, vectors, transaction)` | Create multiple flat records. `vectors` accepts both a flat list of dicts (one per row, auto-wrapped) and a nested list of lists (explicit per-row entries) |
48+
| `import_json(data, label, *, options, transaction)` | Import nested/complex JSON payloads; `label` may be omitted for container objects whose top-level values are objects or arrays of nested records |
49+
| `import_csv(label, data, *, options, parse_config, vectors, transaction)` | Import records from CSV text |
50+
| `upsert(data, label, *, options, vectors, transaction)` | Create or update a record |
51+
| `set(target, data, *, label, vectors, transaction)` | Replace all fields of a record |
52+
| `update(target, data, *, transaction)` | Partially update a record |
53+
| `find(search_query, *, record_id, transaction)` | Search records; returns `SearchResult` |
54+
| `find_one(search_query, *, transaction)` | Return the first match or `None` |
55+
| `find_uniq(search_query, *, transaction)` | Return the single match or `None`; raises if more than one |
56+
| `find_by_id(target, *, transaction)` | Fetch record(s) by ID |
57+
| `delete(search_query, *, transaction)` | Delete all records matching a query |
58+
| `delete_by_id(target, *, transaction)` | Delete record(s) by ID |
59+
| `attach(source, target, *, options, transaction)` | Create relationships between records |
60+
| `detach(source, target, *, options, transaction)` | Remove relationships between records |
61+
| `export(search_query, *, transaction)` | Export matching records as CSV text |
6262

6363
### `db.tx`
6464

docs/docs/learn/reference/typescript/DBRecordInstance.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,28 @@ data?: DBRecordInferred<S, Q>
4545

4646
The actual record data, which may include computed metric fields if the record was retrieved via a query with select/groupBy. The legacy aggregate clause is deprecated and only present for vector similarity until select supports it.
4747

48+
### score
49+
50+
```typescript
51+
get score(): number | undefined
52+
```
53+
54+
Relevance score from a vector/semantic search result. Returns `undefined` for records fetched outside of `records.vectorSearch()`.
55+
56+
**Example:**
57+
58+
```typescript
59+
const results = await db.records.vectorSearch({
60+
labels: ['DOC'],
61+
propertyName: 'content',
62+
query: 'machine learning',
63+
limit: 10
64+
})
65+
results.forEach((r) => {
66+
console.log(r.score) // e.g. 0.9214; undefined for non-vector results
67+
})
68+
```
69+
4870
## Methods
4971

5072
### exists()

docs/docs/learn/reference/typescript/RushDB.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -50,24 +50,24 @@ All database operations are accessed through sub-namespaces on the client instan
5050

5151
CRUD, import, export, and relationship operations on records.
5252

53-
| Method | Description |
54-
| ---------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
55-
| `create({ label, data, options, vectors }, transaction)` | Create a single record |
56-
| `createMany({ label, data, options, vectors }, transaction)` | Create multiple flat records; supports upsert via `options.mergeBy` |
57-
| `importJson({ label, data, options }, transaction)` | Import nested or complex JSON payloads; `label` may be omitted for container objects whose top-level values are objects or arrays of nested records |
58-
| `importCsv({ label, data, options, parseConfig, parentId, vectors }, transaction)` | Import records from CSV text; supports upsert via `options.mergeBy` |
59-
| `upsert({ label, data, options, vectors }, transaction)` | Create or update a record by properties in `options.mergeBy` |
60-
| `set({ target, label, data, options, vectors }, transaction)` | Replace all fields of a record |
61-
| `update({ target, label, data, options }, transaction)` | Partially update a record |
62-
| `find(searchQuery, transaction)` | Search records |
63-
| `findOne(searchQuery, transaction)` | Return the first match |
64-
| `findUniq(searchQuery, transaction)` | Return the single match; raises if ambiguous |
65-
| `findById(idOrIds, transaction)` | Fetch record(s) by ID |
66-
| `delete(searchQuery, transaction)` | Delete all records matching a query |
67-
| `deleteById(idOrIds, transaction)` | Delete record(s) by ID |
68-
| `attach({ source, target, options }, transaction)` | Create relationships between records |
69-
| `detach({ source, target, options }, transaction)` | Remove relationships between records |
70-
| `export(searchQuery, transaction)` | Export matching records as CSV text |
53+
| Method | Description |
54+
| ---------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
55+
| `create({ label, data, options, vectors }, transaction)` | Create a single record |
56+
| `createMany({ label, data, options, vectors }, transaction)` | Create multiple flat records; supports upsert via `options.mergeBy`. `vectors` accepts both `VectorEntry[]` (one per row, auto-wrapped) and `VectorEntry[][]` (explicit per-row lists) |
57+
| `importJson({ label, data, options }, transaction)` | Import nested or complex JSON payloads; `label` may be omitted for container objects whose top-level values are objects or arrays of nested records |
58+
| `importCsv({ label, data, options, parseConfig, parentId, vectors }, transaction)` | Import records from CSV text; supports upsert via `options.mergeBy` |
59+
| `upsert({ label, data, options, vectors }, transaction)` | Create or update a record by properties in `options.mergeBy` |
60+
| `set({ target, label, data, options, vectors }, transaction)` | Replace all fields of a record |
61+
| `update({ target, label, data, options }, transaction)` | Partially update a record |
62+
| `find(searchQuery, transaction)` | Search records |
63+
| `findOne(searchQuery, transaction)` | Return the first match |
64+
| `findUniq(searchQuery, transaction)` | Return the single match; raises if ambiguous |
65+
| `findById(idOrIds, transaction)` | Fetch record(s) by ID |
66+
| `delete(searchQuery, transaction)` | Delete all records matching a query |
67+
| `deleteById(idOrIds, transaction)` | Delete record(s) by ID |
68+
| `attach({ source, target, options }, transaction)` | Create relationships between records |
69+
| `detach({ source, target, options }, transaction)` | Remove relationships between records |
70+
| `export(searchQuery, transaction)` | Export matching records as CSV text |
7171

7272
For bulk imports, pass `options: { mergeBy: ['propertyName'], mergeStrategy: 'append' | 'rewrite' }` to upsert by property instead of creating duplicates. See [Upsert by Property During Import](/learn/records-and-queries/import-data#upsert-by-property-during-import).
7373

0 commit comments

Comments
 (0)