I have the following class methods:
def queryCollection(self, query_string={}, distinct_output = "_id"):
output_array = []
for property in self.coll.find(query_string).distinct(distinct_output):
output_array.append(property)
return set(output_array)
def smallDateQuery(self):
x = self.queryCollection( { "created_at": {"$gte" : datetime(2015, 3, 1), "$lt": datetime(2015, 3, 30)}} )
return x
When I call the first one, it works:
x = user.queryCollection({ "created_at": {"$gte" : datetime(2015, 3, 1), "$lt": datetime(2015, 3, 30)}})
print len(x)
When I call the second, it does not:
y = user.smallDateQuery()
print len(y)
quit()
I get the following error:
x = self.queryCollection( { "created_at": {"$gte" : datetime(2015, 3, 1), "$lt": datetime(2015, 3, 30)}} )
TypeError: 'module' object is not callable
What is the issue?