Automatically assigned IDs are not guaranteed to be sequential, so if you want to rely on ordering your entities you should either assign IDs yourself (which I wouldn't recommend), or sort by another property (perhaps a creation timestamp?)
With that said, you can filter by ID using the special __key__
property. See Key Filters.