Closed photonbit closed 11 months ago
@photonbit That is confusing from the source, thanks for pointing that out. The first comment, from Index, is only used for table creation, which is meant just for setting up tests at this point, and that only supports keys only indexes.
But all indexes should be supported, just by passing the index name as a string to the query function. If an index does not include all the attributes, the resulting models will error when you try to access a missing attribute (until you call refresh(), or if you pass load_full_item=True
to query.
Perfect, thank you!
I am trying from pynamodb to dyntastic and I am finding trouble to understand how to use indexes or which ones are supported. I've found some misleading clues:
https://github.com/nayaverdier/dyntastic/blob/main/dyntastic/main.py#L66
https://github.com/nayaverdier/dyntastic/blob/main/dyntastic/main.py#L98
https://github.com/nayaverdier/dyntastic/blob/main/README.md?plain=1#L164
So what are the projections supported?
Also, how could we use the
dyntastic.Index
class so I can add the index as a field to another model?