Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-28855

Generate string constants for field names in IDL

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 3.5.7
    • None
    • None
    • None
    • Fully Compatible
    • Platforms 2017-05-08

    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.

      Attachments

        Activity

          People

            mark.benvenuto@mongodb.com Mark Benvenuto
            mark.benvenuto@mongodb.com Mark Benvenuto
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: