[SERVER-25893] Make it easier to construct a Value from a vector<Value> or vector<Document> Created: 31/Aug/16  Updated: 02/Oct/20  Resolved: 02/Oct/20

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Improvement Priority: Major - P3
Reporter: Charlie Swanson Assignee: Ted Tuckman
Resolution: Done Votes: 0
Labels: qopt-team, quick-tech-debt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Query 2020-03-23, Query 2020-04-06, Query 2020-04-20
Participants:

 Description   

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>)



 Comments   
Comment by Githook User [ 02/Oct/20 ]

Author:

{'name': 'Ted Tuckman', 'email': 'ted.tuckman@mongodb.com', 'username': 'TedTuckman'}

Message: SERVER-25893 Make it easier to construct a Value from a Vector
Branch: master
https://github.com/mongodb/mongo/commit/0348620630f3dd86214676e7e9566a6aa6e6be5c

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