I want to query with Python mongodb but "DeprecationWarning: count is deprecated. Use Collection.count_documents instead." gives such an error. How do I solve this?
I want to query with Python mongodb but "DeprecationWarning: count is deprecated. Use Collection.count_documents instead." gives such an error. How do I solve this?
Just use the new method count_documents as count is deprecated
mycol.count_documents(myquery)
https://docs.mongodb.com/manual/reference/method/db.collection.countDocuments/