如果您有日期,如何根据文档获取Vapor?

时间:2018-01-08 09:52:12

标签: mongodb vapor

let d3 = try collection.find("dateModified" >= lastUpdateCheck, sortedBy: nil, projecting: p)

您如何创建此Query "dateModified" >= lastUpdateCheck,但基于Document构造函数?

enter image description here

1 个答案:

答案 0 :(得分:1)

df['date'] = pd.to_datetime(df['date'])
df['just_date'] = df['date'].dt.date
df['just_hour'] = df['date'].dt.hour

df['Period'] = df.just_date.astype(str).str.cat(df.just_hour.astype(str), sep=' ') + ':00:00'

有关MongoKitten查询的详细信息:https://medium.com/@joannis.orlandos/the-mongokitten-query-object-8de2964d1b23

有关MongoDB查询的更多信息:https://docs.mongodb.com/manual/reference/operator/query/

关于在MongoKitten中使用MongoDB教程的补充文章:https://medium.com/@joannis.orlandos/interpreting-official-mongodb-tutorials-and-applying-them-in-mongokitten-e34f62ba9969