vogels icon indicating copy to clipboard operation
vogels copied to clipboard

conditional get an item using get()

Open avtaniket opened this issue 8 years ago • 1 comments

Can we do conditional get an item using get() as below?

let conditonParams = {isDeleted: false};
Account.get('[email protected]', {ConsistentRead: true, conditons : conditonParams}, function (err, acc) {
  console.log('got account', acc.get('email'));
})

I know we can do conditional fetch using query() and scan()

Thanks in advance

avtaniket avatar Sep 22 '17 07:09 avtaniket

You can define that isDeleted as a secondary index. http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/SecondaryIndexes.html

set-killer avatar Sep 22 '17 09:09 set-killer