Could not resolve primary key on find.
See original GitHub issueHello,
I’m trying to do a simple find on a GSI but I have the error "id" was referenced in ITEM#{{id}} but it's value could not be resolved.
even if it’s not used in the request
Here is my code
import { Attribute, AUTO_GENERATE_ATTRIBUTE_STRATEGY, AutoGenerateAttribute, Entity, INDEX_TYPE } from '@typedorm/common';
@Entity({
name: 'item',
primaryKey: {
partitionKey: 'ITEM#{{id}}',
sortKey: 'ITEM#{{id}}',
},
indexes: {
GSI1: {
type: INDEX_TYPE.GSI,
partitionKey: 'PARENT#{{parentId}}',
sortKey: 'CREATED_AT#{{createdAt}}',
},
},
})
export class Item{
@AutoGenerateAttribute({
strategy: AUTO_GENERATE_ATTRIBUTE_STRATEGY.UUID4,
})
id!: string;
@Attribute()
parentId!: string;
@AutoGenerateAttribute({
strategy: AUTO_GENERATE_ATTRIBUTE_STRATEGY.EPOCH_DATE,
})
createdAt: string;
@AutoGenerateAttribute({
strategy: AUTO_GENERATE_ATTRIBUTE_STRATEGY.EPOCH_DATE,
autoUpdate: true,
})
updatedAt: string;
}
// Dynamodb request
const items = await entityManager.find(Item, { parentId: "parent-1", queryIndex: "GSI1" })
// ERROR [ExceptionsHandler] "id" was referenced in ITEM#{{id}} but it's value could not be resolved.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
could not resolve property: composite key in query - Stack ...
I am trying to fetch the list of records from a view which has a composite primary key with three columns.
Read more >Index or primary key cannot contain a Null value (Error 3058)
Solution. To solve this problem, you must enter a value in the primary key field before moving to another record. See also. Access ......
Read more >Hubble for JDE: DX - I receive an error that reads: 'Primary key ...
How to resolve the error: 'Primary key validation check failed: Could not find a primary key for table…'
Read more >Error: Non-Unique value/primary key (or sql_distinct_key ...
If the counts in this query match, the primary key is unique. If the counts do not match, the primary key is not...
Read more >Troubleshooting migration tasks in AWS Database Migration ...
To solve this issue, the current approach is to first precreate the tables and primary keys in the target database. Then use a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I found it here in the docs: https://github.com/typedorm/typedorm/blob/main/docs/guide.md#step-by-step-guide Just ctrl+f for queryIndex.
🎉 This issue has been resolved in version 1.15.0-beta.5 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀