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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electrodb",
3
- "version": "3.4.5",
3
+ "version": "3.4.6",
4
4
  "description": "A library to more easily create and interact with multiple entities and heretical relationships in dynamodb",
5
5
  "main": "index.js",
6
6
  "scripts": {
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 = Object.entries(
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.push([key, value]);
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
@@ -165,7 +165,7 @@ const ErrorCodes = {
165
165
  },
166
166
  IncompleteCompositeAttributes: {
167
167
  code: 2002,
168
- section: "incomplete-composite-attributes",
168
+ section: "missing-composite-attributes",
169
169
  name: "IncompleteCompositeAttributes",
170
170
  sym: ErrorCode,
171
171
  },