If your model is like this :
export class Model {
@hashKey({attributeName: 'HashKey'})
private _hashKey!: string;
@rangeKey({attributeName: 'SortKey'})
private _sortKey!: string;
And if I try to use the executeUpdateExpression method as :
const itemKey = {
HashKey: <some-key>,
SortKey: <some-key>,
};
await this.mapper.executeUpdateExpression(updateExpression, itemKey, noArgsConstructor);
We get “The provided key element does not match the schema” error. But it works fine if use this instead :
const itemKey = {
_hashKey: <some-key>,
_sortKey: <some-key>,
};
await this.mapper.executeUpdateExpression(updateExpression, itemKey, noArgsConstructor);