Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-29081

Add toBSON to IDL generated classes.

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.5.7
    • Component/s: None
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Epic Link:
    • Sprint:
      Platforms 2017-05-29

      Description

      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();
      }
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: