I'm using dynamodb-onetable and trying to add ttl to the Model in a schema as described here: https://github.com/sensedeep/dynamodb-onetable
this is what my model looks like
SocketSession: {
pk: { type: String, value: "${_type}_${socketSessionId}" },
sk: { type: String, value: "${_type}_" },
socketSessionId: { type: String },
userId: { type: String },
ttl: {
ttl: true,
type: Number, default: () => {
return Math.floor(Date.now() / 1000 + 10)
} },
gs1pk: { type: String, value: "${_type}_" },
gs1sk: { type: String, value: "${_type}_${socketSessionId}" },
}
The date is inserted into the TTL field correctly but nothing happens after 10 seconds. the entry stays there.
What am I missing?