[SERVER-28936] Add support for alternate names for fields in generated code in IDL Created: 24/Apr/17  Updated: 30/Oct/23  Resolved: 25/Apr/17

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

Type: Task Priority: Major - P3
Reporter: Mark Benvenuto Assignee: Mark Benvenuto
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Platforms 2017-05-08
Participants:

 Description   

For some IDL generated classes, it is desirable to differentiate between the field names in BSON and the names in the generated C++ code. A good example of this is oplog entries which use one and two letter field names to keep the BSON small but may desire for the code to have a more verbose description of a field.

Example:

    demo_struct:
        fields:
            o:
                type: int
                cpp_name: operation

Instead of generating:

std::int32_t getO() const;
void setO(std::int32_t value) const;

more descriptive names will be used instead.

std::int32_t getOperation() const;
void setOperation(std::int32_t value) const;

Reported by judah.schvimer



 Comments   
Comment by Githook User [ 25/Apr/17 ]

Author:

{u'username': u'markbenvenuto', u'name': u'Mark Benvenuto', u'email': u'mark.benvenuto@mongodb.com'}

Message: SERVER-28936 Add support for alternate names for fields in generated code in IDL
Branch: master
https://github.com/mongodb/mongo/commit/38d659ea767f4179eecdb6a2d6fdd7a024e60f33

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