[SERVER-29919] Consider changing BSONElement::operator[] to take StringData instead of const string& Created: 29/Jun/17  Updated: 30/Oct/23  Resolved: 05/Jul/17

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 3.5.10

Type: Improvement Priority: Major - P3
Reporter: James Wahlin Assignee: James Wahlin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Query 2017-07-10
Participants:

 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.



 Comments   
Comment by Githook User [ 05/Jul/17 ]

Author:

{u'username': u'jameswahlin', u'name': u'James Wahlin', u'email': u'james@mongodb.com'}

Message: SERVER-29919 Change BSONElement::operator[] to take field as StringData
Branch: master
https://github.com/mongodb/mongo/commit/b5466d26199389c192814bf9f7e5d618ca6ec588

Generated at Thu Feb 08 04:22:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.