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

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 3.5.10
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • Query 2017-07-10
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      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.

            Assignee:
            James Wahlin
            Reporter:
            James Wahlin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: