-
Type: New Feature
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
-
Platforms 2017-05-29
In testing a lot of IDL generated classes, a common pattern is the following:
BSONObjBuilder builder;
obj.serialize(&builder)
auto doc = builder.obj();
In order to reduce the amount of copy/pasted code, the following method will be added to IDL generated classes for testing IDL classes.
BSONObj toBSON() {
BSONObjBuilder builder;
obj.serialize(&builder)
return builder.obj();
}