@taladb/node 0.8.2 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts
CHANGED
|
@@ -16,6 +16,20 @@ export declare class TalaDbNode {
|
|
|
16
16
|
* every collection returned by `collection()`.
|
|
17
17
|
*/
|
|
18
18
|
static open(path: string, configJson?: string | undefined | null): TalaDbNode
|
|
19
|
+
/**
|
|
20
|
+
* Compact the underlying storage file, reclaiming space freed by deletes
|
|
21
|
+
* and updates. Call during idle periods after large bulk deletes or
|
|
22
|
+
* tombstone compaction. Returns the number of bytes reclaimed (may be 0).
|
|
23
|
+
*/
|
|
24
|
+
compact(): void
|
|
25
|
+
/**
|
|
26
|
+
* Close the database, releasing the file handle and its lock.
|
|
27
|
+
*
|
|
28
|
+
* Subsequent calls on this object return an error. Collections obtained
|
|
29
|
+
* before `close()` keep the underlying storage alive until they are
|
|
30
|
+
* garbage-collected — drop them too to fully release the file.
|
|
31
|
+
*/
|
|
32
|
+
close(): void
|
|
19
33
|
/**
|
|
20
34
|
* Get a collection by name. If an HTTP sync hook is configured it is
|
|
21
35
|
* automatically attached to the returned collection.
|
|
@@ -69,4 +83,36 @@ export declare class CollectionNode {
|
|
|
69
83
|
* Returns an array of `{ document: {...}, score: number }` objects.
|
|
70
84
|
*/
|
|
71
85
|
findNearest(field: string, query: Array<number>, topK: number, filter?: JsonValue | undefined | null): Array<JsonValue>
|
|
86
|
+
/**
|
|
87
|
+
* Zero-copy Float32Array fast path. Avoids the f64→f32 conversion loop
|
|
88
|
+
* used by `findNearest(number[])`, which matters for large embeddings
|
|
89
|
+
* (768/1024/1536 dims) called on the hot path.
|
|
90
|
+
*/
|
|
91
|
+
findNearestF32(field: string, query: Float32Array, topK: number, filter?: JsonValue | undefined | null): Array<JsonValue>
|
|
92
|
+
/**
|
|
93
|
+
* Async variant of `findNearest` — runs on the libuv thread pool so large
|
|
94
|
+
* scans or unfiltered HNSW queries don't block the JS thread. Accepts a
|
|
95
|
+
* `Float32Array` for zero-copy embedding transfer.
|
|
96
|
+
*/
|
|
97
|
+
findNearestAsync(field: string, query: Float32Array, topK: number, filter?: JsonValue | undefined | null): Promise<Array<any>>
|
|
98
|
+
/**
|
|
99
|
+
* Async variant of `find` — runs on the libuv thread pool so large
|
|
100
|
+
* collection scans don't block the JS thread.
|
|
101
|
+
*/
|
|
102
|
+
findAsync(filter: JsonValue): Promise<Array<any>>
|
|
103
|
+
/**
|
|
104
|
+
* Async variant of `insert` — the write (and any HTTP sync hook retries)
|
|
105
|
+
* runs on the libuv thread pool instead of blocking the JS thread.
|
|
106
|
+
*/
|
|
107
|
+
insertAsync(doc: JsonValue): Promise<string>
|
|
108
|
+
/** Async variant of `insertMany`. */
|
|
109
|
+
insertManyAsync(docs: Array<JsonValue>): Promise<Array<string>>
|
|
110
|
+
/** Async variant of `updateOne`. */
|
|
111
|
+
updateOneAsync(filter: JsonValue, update: JsonValue): Promise<boolean>
|
|
112
|
+
/** Async variant of `updateMany`. */
|
|
113
|
+
updateManyAsync(filter: JsonValue, update: JsonValue): Promise<number>
|
|
114
|
+
/** Async variant of `deleteOne`. */
|
|
115
|
+
deleteOneAsync(filter: JsonValue): Promise<boolean>
|
|
116
|
+
/** Async variant of `deleteMany`. */
|
|
117
|
+
deleteManyAsync(filter: JsonValue): Promise<number>
|
|
72
118
|
}
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|