I'm searching for a solution to this but could not find any practical one
lets say we have a pymongo
collection
string and we are searching for string named "tk_dd_id"
in it.
collection = Collection(Database(MongoClient(host=['123234'], document_class=dict, tz_aware=False, connect=True, ssl=True, replicaset='mongomongo'), 'health_cards'), 'tk_dd_id')
I tried
if "tk_dd_id" in collection:
print("Found!")
'Collection' object is not iterable
type(collection)
if any("tk_dd_id" in s for s in collection):
print("Found!")
'Collection' object is not iterable
type(collection)
<class 'pymongo.collection.Collection'>