MongoDB / Pymongo Query with Datetime

后端 未结 1 1726
夕颜
夕颜 2020-12-16 16:06

I am trying to retrieve the data I have inserted into mongodb via pymongo.

My code for insert is below (after parsing via regex)

if connection is not         


        
相关标签:
1条回答
  • 2020-12-16 17:05

    Repeating existing basic tutorial documentation:

    start = datetime.datetime(2012, 2, 2, 6, 35, 6, 764)
    end = datetime.datetime(2012, 2, 2, 6, 55, 3, 381)
    
    for doc in db.wing_model.find({'time': {'$gte': start, '$lt': end}}):
        print doc
    

    Finally, why does the same query return different cursor object locations?

    Where should that be the case?

    You see two different cursor instances which will likely return the same result set - or?

    0 讨论(0)
提交回复
热议问题