Issue in retrieving data from mongDB

Hi

Iam a beginner in python coding. I have a requirement to get the count from one column which is of Object type from mongodb. Below is the code which i have tried but getting the value as 0.Could you please help.From my research it seems propertyCount is cursor,but unable to get the desired result.

from pymongo import MongoClient
from pprint import pprint
conn = MongoClient(“xx.xx.xx.xx:27017”)
with conn:
db=conn.travel.Datatable
propertyCount=db.find({“metadata.status” : “VALID”}).count()
pprint(propertyCount)

When running the query in robomongo the result is as follows.
db.getCollection(‘Datatable’).find({“metaData.status” : “VALID”}).count()
342045