Elffuss BraidHub

kikocis/lancedb public

main · 2.2 KiBRenderedRawPermalink
1[vectordb](../README.md) / [Exports](../modules.md) / MergeInsertArgs
2
3# Interface: MergeInsertArgs
4
5## Table of contents
6
7### Properties
8
9- [whenMatchedUpdateAll](MergeInsertArgs.md#whenmatchedupdateall)
10- [whenNotMatchedBySourceDelete](MergeInsertArgs.md#whennotmatchedbysourcedelete)
11- [whenNotMatchedInsertAll](MergeInsertArgs.md#whennotmatchedinsertall)
12
13## Properties
14
15### whenMatchedUpdateAll
16
17• `Optional` **whenMatchedUpdateAll**: `string` \| `boolean`
18
19If true then rows that exist in both the source table (new data) and
20the target table (old data) will be updated, replacing the old row
21with the corresponding matching row.
22
23If there are multiple matches then the behavior is undefined.
24Currently this causes multiple copies of the row to be created
25but that behavior is subject to change.
26
27Optionally, a filter can be specified. This should be an SQL
28filter where fields with the prefix "target." refer to fields
29in the target table (old data) and fields with the prefix
30"source." refer to fields in the source table (new data). For
31example, the filter "target.lastUpdated < source.lastUpdated" will
32only update matched rows when the incoming `lastUpdated` value is
33newer.
34
35Rows that do not match the filter will not be updated. Rows that
36do not match the filter do become "not matched" rows.
37
38#### Defined in
39
40[index.ts:690](https://github.com/lancedb/lancedb/blob/92179835/node/src/index.ts#L690)
41
42___
43
44### whenNotMatchedBySourceDelete
45
46• `Optional` **whenNotMatchedBySourceDelete**: `string` \| `boolean`
47
48If true then rows that exist only in the target table (old data)
49will be deleted.
50
51If this is a string then it will be treated as an SQL filter and
52only rows that both do not match any row in the source table and
53match the given filter will be deleted.
54
55This can be used to replace a selection of existing data with
56new data.
57
58#### Defined in
59
60[index.ts:707](https://github.com/lancedb/lancedb/blob/92179835/node/src/index.ts#L707)
61
62___
63
64### whenNotMatchedInsertAll
65
66• `Optional` **whenNotMatchedInsertAll**: `boolean`
67
68If true then rows that exist only in the source table (new data)
69will be inserted into the target table.
70
71#### Defined in
72
73[index.ts:695](https://github.com/lancedb/lancedb/blob/92179835/node/src/index.ts#L695)