I need to run a query on a collection that contains a timestamp string ("YYYYMMDD:HH:MM:SS.SSSS"). I want to find all documents that have an hour less than 9 and hour greater than 14. SQL offers the MID() function but I couldn't find an equivalent function. How can I run this query in C++? If you don't know how to in C++ but in mongo shell let me know, I may be able to convert it to C++.
UPDATE Using JohnnyHK's suggestion below, I tried:
BSONObj queryafter = BSONObjBuilder().appendRegex("date", "........:0[0-8]").obj();
BSONObj queryafter = BSONObjBuilder().appendRegex("date", "........:[17-23]").obj();
c.update(dbcol, Query(querybefore), BSON("$set"<<BSON("noise"<<"true")), false, true);
It compiled but it didn't filter correctly.