pymongo查询昨天记录

today = datetime.utcnow()
yesterday = today + timedelta(days=-1)
record = [x for x in db.collection.find({'updatedAt': {'$gte': yesterday, '$lt': today}})]

 

posted @ 2019-07-18 14:01  yudis  阅读(141)  评论(0编辑  收藏  举报