Cursor.count() deprecated. And Collection.count_documents({}) produce different result

Edit: count() still works but produce warning message. And the result is still not consistent with the lecture.

Hi, I was going through the basic read video and try to follow along in my jupyter notebook and this happened

The system stated that the cursor.count() function is Deprecated and asked me to use Collection.count_document(). I tried the method with the cursor object but failed.

After looking back to the first lecture. I had the count_documents({}) working.

However, the return number was different from the lecture. 21 instead of 29.

Hi @Quang_80634,

You are right! But the dataset used in the lecture has been modified for the course and that is why it is showing different output.


1 Like

Thanks @Kanika.