@taladb/node 0.9.2 → 0.9.4
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
|
@@ -87,6 +87,21 @@ export declare class CollectionNode {
|
|
|
87
87
|
insert(doc: JsonValue): string
|
|
88
88
|
/** Insert multiple documents. */
|
|
89
89
|
insertMany(docs: Array<JsonValue>): Array<string>
|
|
90
|
+
/**
|
|
91
|
+
* Upsert many documents **by caller-supplied `_id`**, in one commit.
|
|
92
|
+
*
|
|
93
|
+
* Unlike `insertMany` — which discards `_id` and mints a fresh ULID — this
|
|
94
|
+
* honours the id on each document, which is what lets replication address a
|
|
95
|
+
* remote row by a *derived* id so repeated fetches converge on one document
|
|
96
|
+
* rather than duplicating it.
|
|
97
|
+
*
|
|
98
|
+
* `origin` is `"remote"` for authoritative rows replicated in from an origin,
|
|
99
|
+
* or `"local"` for ordinary user writes. Remote rows are marked so they can
|
|
100
|
+
* never replicate back out.
|
|
101
|
+
*/
|
|
102
|
+
replaceManyWithIds(docs: Array<JsonValue>, origin: string): Array<string>
|
|
103
|
+
/** Delete many documents by id, in one commit. Returns the number removed. */
|
|
104
|
+
deleteManyWithIds(ids: Array<string>, origin: string): number
|
|
90
105
|
/** Find documents matching the filter. */
|
|
91
106
|
find(filter: JsonValue): Array<JsonValue>
|
|
92
107
|
/** Find a single document or return null. */
|
|
@@ -163,6 +178,15 @@ export declare class CollectionNode {
|
|
|
163
178
|
insertAsync(doc: JsonValue): Promise<string>
|
|
164
179
|
/** Async variant of `insertMany`. */
|
|
165
180
|
insertManyAsync(docs: Array<JsonValue>): Promise<Array<string>>
|
|
181
|
+
/**
|
|
182
|
+
* `replaceManyWithIds` on the libuv thread pool.
|
|
183
|
+
*
|
|
184
|
+
* The bulk path: a hydration page is hundreds of rows in one commit, and with
|
|
185
|
+
* fsync-per-commit durability that is long enough to stall the event loop.
|
|
186
|
+
*/
|
|
187
|
+
replaceManyWithIdsAsync(docs: Array<JsonValue>, origin: string): Promise<unknown>
|
|
188
|
+
/** `deleteManyWithIds` on the libuv thread pool. */
|
|
189
|
+
deleteManyWithIdsAsync(ids: Array<string>, origin: string): Promise<unknown>
|
|
166
190
|
/** Async variant of `updateOne`. */
|
|
167
191
|
updateOneAsync(filter: JsonValue, update: JsonValue): Promise<boolean>
|
|
168
192
|
/** Async variant of `updateMany`. */
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|