As per my understanding. A query operation will seek results on the mentioned index until one of the following condition is met
- The result set is exhausted.
- The number of items retrieved reaches the value of the Limit parameter, if specified.
- The amount of data retrieved reaches the maximum result set size limit of 1 MB. Documented Here
So DynamoDB query will fetch results as per above criteria and then it will apply the FilterExpression so it is quite possible that it might not return any results to you, so it will return empty set and a LastEvaluatedKey
But I also read the following in the documentation
Unlike a Scan operation, a Query operation never returns both an empty result set and a LastEvaluatedKey value.
Can someone please help in explaining what does the above documentation statement actually mean?
Because in practice when I user queryPage API with limit and FilterExpression I am getting opposite of it, i.e. I am getting an empty set as well as LastEvaluatedKey.
Is my above understanding correct? It is possible to get both an empty results and lastEvaluatedKey value? Or I am missing something because of which I am getting empty results? (as per documentation I should not get it. It would be great if I don't get empty results)