dynamodb-toolbox / dynamodb-toolbox/dynamodb-toolbox
Infer properties without storing them on the table
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 185
- Avg merge
- 1d 17m
- Merged PRs (30d)
- 20
Description
Hello!
I have a question regarding something that I haven't been able to figure out just by looking at the documentation.
I have the following entity sample:
```
const UserTodoEntity = new Entity({
name: "UserTodo",
table,
schema: item({
userId: string().transform(prefix("USER")).savedAs("PK").key(),
projectId: string().key(),
todoId: string().key(),
isActive: boolean(),
}),
computeKey: ({ userId, projectId, todoId }) => ({
PK: userId,
SK: `PROJECT#${projectId}#TODO#${todoId}`,
}),
});
```
Looking at the data stored on the table, I see that projectId and todoId, on top of being available within the SK, are also stored as attributes - albeit they could be inferred through the SK.
Is there a way to do this?
Thank you!
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.