[SERVER-28855] Generate string constants for field names in IDL Created: 18/Apr/17  Updated: 30/Oct/23  Resolved: 02/May/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   

IDL consumers may need to reference the field names in code. To enable one definition for a field name, IDL should generate string constants for each field name in a class.

For a document like this

{
   "example" : "test"
}

A mockup of what the generated code could look like:

class Sample {
constexpr StringData kExampleField = "example";
}

The idea came from judah.schvimer for SERVER-28621.



 Comments   
Comment by Githook User [ 02/May/17 ]

Author:

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

Message: SERVER-28855 Generate string constants for field names in IDL
Branch: master
https://github.com/mongodb/mongo/commit/3d06c50d9427ac64785d2b62ca368010890aa9be

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