electrodb 3.4.5 → 3.4.6
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/package.json +1 -1
- package/src/clauses.js +3 -5
- package/src/errors.js +1 -1
package/package.json
CHANGED
package/src/clauses.js
CHANGED
|
@@ -464,21 +464,19 @@ let clauses = {
|
|
|
464
464
|
upsert.indexKey = indexKey;
|
|
465
465
|
|
|
466
466
|
// only "set" data is used to make keys
|
|
467
|
-
const setFields =
|
|
468
|
-
entity.model.schema.translateToFields(setAttributes),
|
|
469
|
-
);
|
|
467
|
+
const setFields = entity.model.schema.translateToFields(setAttributes);
|
|
470
468
|
|
|
471
469
|
// add the keys impacted except for the table index keys; they are upserted
|
|
472
470
|
// automatically by dynamo
|
|
473
471
|
for (const key in updatedKeys) {
|
|
474
472
|
const value = updatedKeys[key];
|
|
475
473
|
if (indexKey[key] === undefined) {
|
|
476
|
-
setFields
|
|
474
|
+
setFields[key] = value;
|
|
477
475
|
}
|
|
478
476
|
}
|
|
479
477
|
|
|
480
478
|
entity._maybeApplyUpsertUpdate({
|
|
481
|
-
fields: setFields,
|
|
479
|
+
fields: Object.entries(setFields),
|
|
482
480
|
operation: UpsertOperations.set,
|
|
483
481
|
updateProxy,
|
|
484
482
|
update,
|
package/src/errors.js
CHANGED