[SERVER-41563] BSONObjBuilder append* functions should all return ref to *this Created: 06/Jun/19  Updated: 29/Oct/23  Resolved: 07/Jun/19

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: 4.3 Required
Fix Version/s: 4.3.1

Type: Bug Priority: Major - P3
Reporter: Billy Donahue Assignee: Billy Donahue
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Dev Tools 2019-06-17
Participants:

 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.



 Comments   
Comment by Githook User [ 07/Jun/19 ]

Author:

{'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}

Message: SERVER-41563 BSONObjBuilder mutators must return *this
Branch: master
https://github.com/mongodb/mongo/commit/bc918802360d6ffae666dad0ee51ca54721500d2

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