Can someone explain me why is this happen?

Comment From: oranagra

i see it was already answered. Scan is meant to be called multiple times in order to scan the whole database. it could be that some calls return with 0 keys, but you should keep calling it until the returning cursor is 0.