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

BSONObjBuilder append* functions should all return ref to *this

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 4.3.1
    • 4.3 Required
    • Internal Code
    • Fully Compatible
    • ALL
    • Dev Tools 2019-06-17

    Description

      appendUndefined(), for example, returns nothing.
      They all need to return a reference to *this to be used in fluent builder expressions, which BSONObjBuilder is designed to support.

      BSONObj obj = BSONObjBuilder()
          .append("a", 123)
          .appendUndefined("b")    // fail here
          .obj();
      

      This fails because appendUndefined isn't following the convention.

      Attachments

        Activity

          People

            billy.donahue@mongodb.com Billy Donahue
            billy.donahue@mongodb.com Billy Donahue
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: