Skip to content

Commit 7267f5d

Browse files
docs(update-expression-builder): edit comment for special case
1 parent 5ab0c66 commit 7267f5d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/dynamo/expression/update-expression-builder.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ function buildDefaultExpression(
9999

100100
// special case: [same as in buildDefaultConditionExpression]
101101
// we have the metadata for an Array/Set of an Object,
102-
// but only get a single item when using `attribute('myCollectionProp[0]').set({})`
102+
// but only get a single item when using list indexes in attributePath
103+
// e.g. `attribute('myCollectionProp[0]').set(...)`
104+
// (not exclusive to `.set(...)` but all updateActions)
103105
if (/\[\d+\]$/.test(attributePath)) {
104106
attribute = toDbOne(values[0], getPropertyPath(propertyMetadata, attributePath), alterCollectionPropertyMetadataForSingleItem(propertyMetadata))
105107
} else {

0 commit comments

Comments
 (0)