paging fix for Mongo (and maybe other databases)