minidyn
minidyn copied to clipboard
Fix last evaluated key behavior on Query
the query operation documentation says:
If LastEvaluatedKey is empty, then the "last page" of results has been processed and there is no more data to be retrieved.
If LastEvaluatedKey is not empty, it does not necessarily mean that there is more data in the result set. The only way to know when you have reached the end of the result set is when LastEvaluatedKey is empty.
it means that if there is no more items to scan in the index the LastEvaluatedKey should not be returned
Also, if the limit is greater than the index size we should not return the LastEvaluatedKey