-
Notifications
You must be signed in to change notification settings - Fork 184
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Looking to run a conditional update based on the existence of a particular attribute. I expect the type of updatedProgress to match the full entity, but the inferred type is an object which only includes SK. The object returned does include all properties (contrary to the type inference).
This version has the correct expected return type.
const { Attributes: updatedProgress } = await ProgressEntity.update(
{
PK1,
PK2,
SK,
date,
},
{
conditions: [],
returnValues: 'ALL_NEW',
},
);This version does not.
const { Attributes: updatedProgress } = await ProgressEntity.update(
{
PK1,
PK2,
SK,
date,
},
{
conditions: [
{
attr: 'SK',
exists: true,
},
],
returnValues: 'ALL_NEW',
},
);photz-insify
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working