mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
changeSetInsertDocuments improved
This commit is contained in:
parent
9d5c7e6df2
commit
5c080568d8
@ -498,7 +498,12 @@ export function changeSetInsertNewRow(changeSet: ChangeSet, name?: NamedObjectIn
|
||||
};
|
||||
}
|
||||
|
||||
export function changeSetInsertDocuments(changeSet: ChangeSet, documents: any[], name?: NamedObjectInfo): ChangeSet {
|
||||
export function changeSetInsertDocuments(
|
||||
changeSet: ChangeSet,
|
||||
documents: any[],
|
||||
name?: NamedObjectInfo,
|
||||
insertIfNotExistsFieldNames?: string[]
|
||||
): ChangeSet {
|
||||
const insertedRows = getChangeSetInsertedRows(changeSet, name);
|
||||
return {
|
||||
...changeSet,
|
||||
@ -508,6 +513,7 @@ export function changeSetInsertDocuments(changeSet: ChangeSet, documents: any[],
|
||||
...name,
|
||||
insertedRowIndex: insertedRows.length + index,
|
||||
fields: doc,
|
||||
insertIfNotExistsFields: insertIfNotExistsFieldNames ? _.pick(doc, insertIfNotExistsFieldNames) : null,
|
||||
})),
|
||||
],
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user