我正在使用MongoDB和C#4.0。在MongoDB中,我將CreatedOn作爲DateTime存儲,例如「2011-01-01T01:40:45.041Z」。在C#中,我使用的是MongoDB驅動程序,那麼如何查詢特定日期的數據庫呢?到目前爲止,我已經做了如下......如何查詢C#中的MongoDB日期時間?
var fileLogCollection = db.GetCollection<FileLog>();
Document selector = new Document();
selector["CreatedOn"] =dateTimePicker1.Value.Date;
var all = fileLogCollection.Find(selector);
感謝
那麼,它不工作? – 2012-01-01 23:27:25
你讀過[C#驅動教程](http://www.mongodb.org/display/DOCS/CSharp+Driver+Tutorial#CSharpDriverTutorial-FindandFindAsmethods)嗎? – 2012-01-01 23:30:05
是不行的。我讀了它並沒有太大的幫助。我怎麼能把大於在選擇器抱歉它是一個愚蠢的問題,我是新來的。 – user1125435 2012-01-01 23:46:06