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

Add support to construct Documents with an initializer list

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.3.4
    • Affects Version/s: None
    • Component/s: Aggregation Framework
    • None
    • Fully Compatible
    • Query 12 (04/04/16)

      Would allow something like this:

      Document document = {{"a", 1}, {"b", "q"}};
      

      instead of the current syntax, which can get hard to read with increasing numbers of fields:

      Document document = DOC("a" << 1 << "b" << "q");
      

            Assignee:
            charlie.swanson@mongodb.com Charlie Swanson
            Reporter:
            charlie.swanson@mongodb.com Charlie Swanson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: