如何在Mongodb中转换日期字段

我想将mongodb中的日期字段转换为我可以从数据库中检索日期的位置,但是我得到了一个错误,这是请求:

# Main window
root = Tk()
root.title("Restaurants")
root.geometry("800x500")

lines of codes..... where user will select if they want to set the date 
and time

# Popup window
def date_time():
    popup = Tk()
    popup.title("Set Date and Time")
    popup.geometry("500x500")
    popup.grab_set()  # Not working

    lines of codes to run

错误是:db.getcollection('collection').find({ $toDate: date : {$eq:"2018-03-02"} })

PS: 日期存储在mongodb中为:2018-03-02T15:38:48.115

有什么建议吗?

tianyingqi020 回答:如何在Mongodb中转换日期字段

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3160399.html

大家都在问