Open ynie opened 1 year ago
For anyone else trying to find a solution to this issue, another workaround is to use index_name
on the model query, rather than querying the index instance.
i.e. instead of:
results = Credential.date_index.query("", limit=1)
which returns CredentialBase
instances
try:
results = Credential.query("", index_name="my_index_name", limit=1)
which returns Credential
instances
Hey all, I'm new to pynamoDB. Here is my setup
Why wouldn't this work?
results = Credential.date_index.query("", limit=1)
It tries to look up the dateIndex on
CredentialBase
instead ofCredential
. I can fix the problem by moving thedate_index
to the childClassCredential
. Is that the correct way of doing it? Thanks!