vogels
vogels copied to clipboard
conditional get an item using get()
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
You can define that isDeleted as a secondary index.
http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/SecondaryIndexes.html