Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

691
Views
Mongodb DeprecationWarning: count is deprecated. Use Collection.count_documents instead

enter image description here

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?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Just use the new method count_documents as count is deprecated

mycol.count_documents(myquery)

https://pymongo.readthedocs.io/en/stable/api/pymongo/collection.html?highlight=count#pymongo.collection.Collection.count_documents

https://docs.mongodb.com/manual/reference/method/db.collection.countDocuments/

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!