This would be the equivalent of this sql statement?
Select * from example WHERE date = ‘2011-09-21’
db.example.find({date: dateobject});
对于MongoDB PHP,您将需要使用[MongoDate] [2]类来表示这些日期.其他语言驱动程序通常只使用语言日期构造.
I would also like to know the Syntax of the between query.
MongoDB没有between子句.
要使用“大于”,您需要使用其中一个查询运算符.有关详情,请参见here.简单的例子:
db.example.find({ date: { $gt: lowdate,$lt: highdate } });