Reputation: 85
Hi guys and sorry for my bad english. I am using pymongo for querying to mongodb. so when i try to use None as null in my query, I get error: NoneType object is not subscriptable.
Here is an example:
db.collection.find_one({'name': "Nick", 'age': None})
# 'NoneType' object is not subscriptable error
Can you help me to solve this problem, please?
Upvotes: 1
Views: 1780
Reputation: 1563
Although, not tried but try passing null
instead of None
:
db.collection.find_one({'name': "Nick", 'age': null})
Upvotes: 1