As we all know Json is case sensitive and so is MongoDB, hence searching same name which got save in different case might not return any result. The solution is to do case in-sensative search.
Below is the example of pymongo
db.users.find_one({'name': re.compile(username, re.IGNORECASE)})