I'm new to pymongo and having trouble using exists. When using
collection.find({}, { "cwc": { "$exists": True }})
I get the following error
Unsupported projection option: $exists
What I'm trying to accomplish is to find all _id
and cwc
where 'cwc' exists and not empty.
This works for me.
collection.find({"cwc":{"$exists":True}})
The only difference is removed the first argument.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With