python - How do I do greater than/less than using MongoDB? -
i'm using pymongo driver.
can take @ pymongo , tell me how greater than? i"m used doing : everything.
have seen the doc ? take manual :
>>> d = datetime.datetime(2009, 11, 12, 12) >>> post in posts.find({"date": {"$lt": d}}).sort("author"): ... post ... {u'date': datetime.datetime(2009, 11, 10, 10, 45), u'text': u'and pretty easy too!', u'_id': objectid('...'), u'author': u'eliot', u'title': u'mongodb fun'} {u'date': datetime.datetime(2009, 11, 12, 11, 14), u'text': u'another post!', u'_id': objectid('...'), u'author': u'mike', u'tags': [u'bulk', u'insert']}
Comments
Post a Comment