pmiranda
pmiranda

Reputation: 8470

Scan for a type in DynamoDB

Is there a way to Scan for a specific type on field?

For instance, I have a field called "code", I want to scan the items where "code" is a Number. In my DB "code" is always a "String" but I need to get an item where it's stored as Number

Upvotes: 1

Views: 119

Answers (1)

NoSQLKnowHow
NoSQLKnowHow

Reputation: 4865

You'd do a conditional expression to looking for an attribute_type of Number.

That said, how often are you doing this scan as scans can get quite expensive. If this is an out of band scan you have to run periodically to find these and then update then it might be fine. If this is something you need to do far more regularly, you might want to solve this another way with a GSI. It comes down to the velocity, then cost and performance.

Upvotes: 5

Related Questions