I am reading data from pymongo and need to check if column exists or not
[doc for doc in col.find{"IAM":{"$exists":false}}
I am getting and error near false
I have tried to convert false to False, but in mongodb it is not returning anything. how to check if column exists in pymongo?
A few things to correct:
find({})
.False
(capitalised) in python *So your final statement is:
result = list(col.find({"IAM": {"$exists": False}}))
*In the mongo shell / javascript it is false
(lowercase)