Hey People,
I know this is one of the most basic topics but I cant figure out where im going wrong, trying . count()
and .count_documents()
and getting the following error:
Cursor' object has no attribute 'count_documents
Cursor' object has no attribute 'count
.
the code im using is:
uri = "XXXXXXXXXX"
client = MongoClient(URI); # creating an instance of the client
print(client.sample_training.zips.find(
{
"pop" : {"$lt" : 1000}
}
).count_documents())
im feeling quite dumb here…