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

Consider changing BSONElement::operator[] to take StringData instead of const string&

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 3.5.10
    • None
    • None
    • None
    • Fully Compatible
    • Query 2017-07-10

    Description

      It is common in our code base to access BSONObj and BSONElement representing an object via operator[] passing a const c-string for field name. While BSONObj takes StringData for operator[], BSONElement take const string&, which when passed a c-string will result in creation of a std::string object.

      Attachments

        Activity

          People

            james.wahlin@mongodb.com James Wahlin
            james.wahlin@mongodb.com James Wahlin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: