dynamodb-toolbox icon indicating copy to clipboard operation
dynamodb-toolbox copied to clipboard

Cannot reference secondary attributes in condition clauses

Open craPkit opened this issue 3 years ago • 0 comments

I'd like to be able to reference attributes (as an alternative to passing static values) in condition clauses.

const TestEntity = new Entity({
  name: 'TestEntity',
  attributes: {
    pk: { partitionKey: true },
    a: 'string',
    b: 'string',
    c: 'string',
    d: 'string',
    x: 'string',
    y: 'string'
  },
  table: TestTable
});

TestEntity.update({
  ...
  conditions: { attr: 'a', eq: { attr: 'b' } } // yields 'ConditionExpression: "#attr_a > #attr_b"'
});

craPkit avatar Mar 08 '21 12:03 craPkit