Try this :
BSONObjBuilder oB;
BSONObj date = BSONObjBuilder().appendDate("$gt", time(0)*1000-
(3*86400000)).appendDate("$lte", time(0)*1000).obj();
date = BSON("date"<<date);
oB.appendElements(date);
oB.appendRegex("title","google");
BSONObj dateRange = oB.obj();
------------------
And I have a question for you. May be you can help :)
I want to execute a "not exist" query.
I can do this in cmd :
db.test.find({$and : [{x:{$not:/.*o.*/}},{x:{$exists:true}}]})
But I don't know how to build a c++ query.
I tried $not with $regex, it doesn't work neither
Do you have any ideas ?