Need suggestion help with depreciated where(nil) criteria

Hi, I hope you all are good I was facing an issue in mongoid (Mongodb gem for rails). AS we all know that where(nil) criteria have been depreciated. now I want to get all records when nil is passed to where. is there any way out? i am working on an app in which where(nil) has been used profoundly.