Hello!
I’m using pymongo with Python 3.9.4 on Windows 10.
When I do a find and get a Cursor object I call count but that produces this deprecation warning:
DeprecationWarning: count is deprecated. Use Collection.count_documents instead.
The problem there is that deprecation warning is for the Collection class, not the Cursor.
Regardless, I tried just calling count_documents on the object and it cries foul: it’s a Cursor, not a Collection.
res_structs = mongo_coll_structs.find( {‘JobName’ : job_name, ‘ImportStatus’: { ‘$ne’: ‘success’ } }
print("GetStructsForJobs: found this many structs for " + job_name + " : " + str(res_structs.count()))
Here are the packages I have installed:
Package Version
boto3 1.17.51
botocore 1.20.51
jmespath 0.10.0
pip 21.1.1
pymongo 3.11.4
python-dateutil 2.8.1
s3transfer 0.3.7
setuptools 49.2.1
six 1.15.0
urllib3 1.26.4