You can't chain find methods. Calling find
will return the Cursor object. You probably want to build a query and then call find:
from collections import OrderedDict
query = OrderedDict([('symbol', 'AAPL')])
if start is not None:
query['date'] = {'$gte': start}
if end is not None:
query['date'] = {'$lte': end}
cursor = prices.find(query)