Updating indexes
#500
|
Following this discussion I had a plan to add a new index to my entity definition I could then index. primary: {
pk: {
field: 'pk',
composite: ['client_id']
},
sk: {
field: 'sk',
composite: []
}
},
byType: { // <-- This is the new one
index: 'byType',
pk: {
field: 'byTypePk',
composite: []
},
sk: {
field: 'byTypeSk',
composite: ['client_id']
}
}This allows me to easily query for all rows of a type (although to be honest if electrodb allows you to define a a GSI on edb_e that would make this whole problem go away). Performing an update on the entity doesn't seem to update the secondary index and I'm not sure why. Aside from the above, what strategies have people used to add new indexes with new attributes to existing tables? |
Answered by
phawxby
May 28, 2025
Replies: 1 comment
|
Turns out I rectified this by updating electrodb and then doing an inverse GSI on SK/PK so I could then do a query on the SK |
0 replies
Answer selected by
phawxby
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Turns out I rectified this by updating electrodb and then doing an inverse GSI on SK/PK so I could then do a query on the SK