0
0
DynamoDBquery~10 mins

TTL attribute setup 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 specify the TTL attribute name in DynamoDB.

DynamoDB
table.update_time_to_live({
  TTLSpecification: {
    Enabled: true,
    AttributeName: "[1]"
  }
})
Drag options to blanks, or click blank then click option'
AexpirationTime
BexpireAt
Cttl
DdeleteAt
Attempts:
3 left
💡 Hint
Common Mistakes
Using a different attribute name than the one storing the expiration timestamp.
Forgetting to enable TTL in the specification.
2fill in blank
medium

Complete the code to enable TTL on the DynamoDB table.

DynamoDB
table.update_time_to_live({
  TTLSpecification: {
    Enabled: [1],
    AttributeName: "ttl"
  }
})
Drag options to blanks, or click blank then click option'
A1
Bfalse
C"true"
Dtrue
Attempts:
3 left
💡 Hint
Common Mistakes
Using string "true" instead of boolean true.
Setting Enabled to false disables TTL.
3fill in blank
hard

Fix the error in the TTL setup code by completing the missing part.

DynamoDB
const params = {
  TableName: "MyTable",
  [1]: {
    Enabled: true,
    AttributeName: "ttl"
  }
};
Drag options to blanks, or click blank then click option'
ATimeToLiveSpec
BTimeToLiveSpecification
CTTLSpecification
DTTLSpec
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect parameter names like TTLSpecification or TTLSpec.
Misspelling or wrong casing of the parameter name.
4fill in blank
hard

Fill both blanks to correctly configure TTL in the AWS SDK call.

DynamoDB
const params = {
  TableName: "Orders",
  [1]: {
    Enabled: [2],
    AttributeName: "expireAt"
  }
};
Drag options to blanks, or click blank then click option'
ATimeToLiveSpecification
Btrue
Cfalse
DTTLSpecification
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong parameter name.
Setting Enabled to false disables TTL.
5fill in blank
hard

Fill all three blanks to create a TTL update request with correct keys and values.

DynamoDB
const ttlParams = {
  [1]: "Products",
  [2]: {
    Enabled: [3],
    AttributeName: "deletionTime"
  }
};
Drag options to blanks, or click blank then click option'
ATableName
BTimeToLiveSpecification
Ctrue
DTTLSpecification
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the keys or using incorrect names.
Setting Enabled to false disables TTL.