electrodb 3.4.4 → 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/entity.js +9 -3
- 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/entity.js
CHANGED
|
@@ -2012,7 +2012,10 @@ class Entity {
|
|
|
2012
2012
|
);
|
|
2013
2013
|
break;
|
|
2014
2014
|
case MethodTypes.scan:
|
|
2015
|
-
params = this._makeScanParam(
|
|
2015
|
+
params = this._makeScanParam(
|
|
2016
|
+
filter[ExpressionTypes.FilterExpression],
|
|
2017
|
+
config,
|
|
2018
|
+
);
|
|
2016
2019
|
break;
|
|
2017
2020
|
/* istanbul ignore next */
|
|
2018
2021
|
default:
|
|
@@ -2228,7 +2231,7 @@ class Entity {
|
|
|
2228
2231
|
}
|
|
2229
2232
|
|
|
2230
2233
|
/* istanbul ignore next */
|
|
2231
|
-
_makeScanParam(filter = {}) {
|
|
2234
|
+
_makeScanParam(filter = {}, options = {}) {
|
|
2232
2235
|
let indexBase = TableIndex;
|
|
2233
2236
|
let hasSortKey = this.model.lookup.indexHasSortKeys[indexBase];
|
|
2234
2237
|
let accessPattern =
|
|
@@ -2291,7 +2294,10 @@ class Entity {
|
|
|
2291
2294
|
params.FilterExpression = filterExpressions.join(" AND ");
|
|
2292
2295
|
}
|
|
2293
2296
|
|
|
2294
|
-
return
|
|
2297
|
+
return this._applyProjectionExpressions({
|
|
2298
|
+
parameters: params,
|
|
2299
|
+
config: options,
|
|
2300
|
+
});
|
|
2295
2301
|
}
|
|
2296
2302
|
|
|
2297
2303
|
_makeSimpleIndexParams(partition, sort) {
|
package/src/errors.js
CHANGED