0
0
DynamoDBquery~10 mins

Expressions with SDK helpers in DynamoDB - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a condition expression that checks if the attribute "status" equals "active".

DynamoDB
const condition = Attr('status').[1]('active');
Drag options to blanks, or click blank then click option'
Aeq
Bne
Clt
Dcontains
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'ne' which means 'not equal' instead of 'eq'.
Using 'contains' which checks for substring, not equality.
2fill in blank
medium

Complete the code to create a filter expression that checks if the attribute "age" is greater than 30.

DynamoDB
const filter = Attr('age').[1](30);
Drag options to blanks, or click blank then click option'
Alt
Bgt
Ceq
DbeginsWith
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'lt' which means 'less than' instead of 'greater than'.
Using 'beginsWith' which is for strings, not numbers.
3fill in blank
hard

Fix the error in the code to check if the attribute "name" begins with "A".

DynamoDB
const condition = Attr('name').[1]('A');
Drag options to blanks, or click blank then click option'
Aeq
Bcontains
CbeginsWith
Dgt
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'contains' which checks anywhere in the string, not just the start.
Using 'eq' which checks for exact match.
4fill in blank
hard

Fill both blanks to create a condition expression that checks if "score" is between 50 and 100.

DynamoDB
const condition = Attr('score').[1](50).[2](100);
Drag options to blanks, or click blank then click option'
Abetween
Beq
Cne
Dgt
Attempts:
3 left
💡 Hint
Common Mistakes
Using different methods for the two values instead of 'between'.
Using 'eq' or 'ne' which check equality, not range.
5fill in blank
hard

Fill all three blanks to create a filter expression that checks if "category" equals "books" and "price" is less than 20.

DynamoDB
const filter = Attr([1]).[2]('books').and(Attr([3]).lt(20));
Drag options to blanks, or click blank then click option'
A'category'
Beq
C'price'
Dgt
Attempts:
3 left
💡 Hint
Common Mistakes
Using attribute names without quotes.
Using 'gt' instead of 'lt' for price comparison.
Using wrong method instead of 'eq' for equality.