Prabhupad Pradhan

Results 4 comments of Prabhupad Pradhan

#### Code for reproducing this issue: class User(mongoengine.Document): meta = { "db_alias": 'core', "collection": 'so_users_details' } user_name = mongoengine.StringField(required=True) tag_details = mongoengine.ObjectIdField(null=True) User(user_name='Sam').save() User.objects().filter(tag_details=None)

does it make sense to add a null check [here ](https://github.com/MongoEngine/mongoengine/blob/master/mongoengine/base/fields.py) in method `to_mongo` in class ` ObjectIdField` ?

@rykroon-momentum I think that has been done to ensure that ObjectId field should not have any other type of value. But there should be some handling for null objects as...

@rykroon-momentum so what are you suggesting ? and adding a null check [here](https://github.com/MongoEngine/mongoengine/pull/2682) won't do any good in this case ?