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

Make it easier to construct a Value from a vector<Value> or vector<Document>

    • Fully Compatible
    • Query 2020-03-23, Query 2020-04-06, Query 2020-04-20

      A lot of tests have overly verbose code doing something like the following:

      // Construct the document {array: [{a: 1}, {a: 2}]}.
      Document{{"array", vector<Value>{Value(Document{{"a", 1}}), Value(Document{{"a", 2}})}}}
      

      It would be nice to add some type(s) or constructor(s) to make this easier, maybe something like one or more of the following:

      Value::array(std::initializer_list<ImplicitValue>)
      Value(std::vector<Document>)
      

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

              Created:
              Updated:
              Resolved: