-
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? |
Beta Was this translation helpful? Give feedback.
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 |
Beta Was this translation helpful? Give feedback.
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