DynamoDB, TTL not deleting items

0

I set up TTL to delete an item called "epoch" with is just the epoch time casted to an integer. I set up TTL 2 weeks ago, and nothing has been deleted yet. I tried the preview with "payload.epoch" as well, just to check, and no dice. Here is what a JSON entry looks like:

{
 "timestamp": "2022-01-26 13:00:30.676968",
 "payload": {
  "air_flow": 1.5,
  "rssi": -93,
  "temp": 19.09,
  "data": "03d10775018f0a006ff3",
  "rx_freq": 929000000,
  "humidity": 28.659,
  "epoch": 1643230830,
  "ep": 1,
  "pressure": 102154,
  "seq": 71,
  "timestamp": "2022-01-26 13:00:30.676968"
 }
}
Ian
질문됨 2년 전1066회 조회
1개 답변
2
수락된 답변

You must set your TTL attribute as a top level attribute. You cannot have it inside a map:

{
 "timestamp": "2022-01-26 13:00:30.676968",
 "epoch": 1643230830,
 "payload": {
  "air_flow": 1.5,
  "rssi": -93,
  "temp": 19.09,
  "data": "03d10775018f0a006ff3",
  "rx_freq": 929000000,
  "humidity": 28.659,
  "ep": 1,
  "pressure": 102154,
  "seq": 71,
  "timestamp": "2022-01-26 13:00:30.676968"
 }
}
profile pictureAWS
전문가
답변함 2년 전
profile picture
전문가
검토됨 한 달 전
  • I made another table, and used epoch as the primary key instead, it did not delete in the preview. I also made it an item in the top level, along side the primary key, it doesn't delete.

  • You are aware it can take 48 hours. Please provide more details on your table:

    • The output of: aws dynamodb describe-time-to-live --table-name <your table name>

    • A sample item which you expected to have been evicted, including the time it was inserted to the table.

  • output: { "TimeToLiveDescription": { "TimeToLiveStatus": "ENABLED", "AttributeName": "epoch" } } I am aware of the 48 hour period. I was using the "run preview" feature to see what would be deleted in a week, and there are no results in the query.

  • Don't use the preview...it doesn't seem to work

  • I encourage you to use the feedback button in the console, it will alert the team responsible for the preview feature.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠