Skip to content
This repository was archived by the owner on Jun 19, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/dynamodb-data-mapper/src/DataMapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,7 @@ export class DataMapper {
}
let {
condition,
customExpression,
onMissing = 'remove',
skipVersionCheck = this.skipVersionCheck,
} = options;
Expand Down Expand Up @@ -986,6 +987,8 @@ export class DataMapper {
if (onMissing === 'remove') {
expr.remove(key);
}
} else if (customExpression) {
expr.set(key, customExpression)
} else {
const marshalled = marshallValue(fieldSchema, inputMember);
if (marshalled) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ export interface UpdateOptions {
*/
condition?: ConditionExpression;


/**
* A customExpression overwrite Value attribute of UpdateExpression if specfied
*/
customExpression?: AttributeValue | FunctionExpression | MathematicalExpression | any;

/**
* Whether the absence of a value defined in the schema should be treated as
* a directive to remove the property from the item.
Expand Down