Probably it's not something that should be fixed, but error on empty criteria could be a good way to deal with it const res = repo.findById(undefined)