-
Type: New Feature
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
The BSONArrayBuilder class in the MongoDB C++ driver API (http://api.mongodb.org/cplusplus/current/classmongo_1_1_b_s_o_n_array_builder.html) allows to build BSON arrays, eg.
BSONArrayBuilder ba;
ba.append("foo");
ba.append("bar");
...
connection->query("col", BSON("x" << BSON("$in" << ba.arr())));
will do a query equal to the following at mongo shell:
db.col.find({"x": {"$in": [ "foo", "bar" ] }})
However, It seems that BSONArrayBuilder lacks a method to build a query based on regex instead of strings, in the following way (that works at mongo shell):
db.col.find({"x": {"$in": [ /^foo/, /^bar/ ] }})
This issue is about implementing the above functionality (or maybe I'm wrong...
Note that Note that BSONObjBuilder class (http://api.mongodb.org/cplusplus/current/classmongo_1_1_b_s_o_n_obj_builder.html) has an appendRegex() method... I wonder why a similar method has not been included in the BSONArrayBuilder class.
- depends on
-
CXX-278 Merge upstream changes for SERVER-14482
- Closed