diff options
author | Charlie Swanson <charlie.swanson@mongodb.com> | 2016-06-23 17:47:13 -0400 |
---|---|---|
committer | Charlie Swanson <charlie.swanson@mongodb.com> | 2016-06-24 11:51:20 -0400 |
commit | 20e9b2798d69fb2367ff9f16a1b30f4f9b73d93b (patch) | |
tree | 19acf1fff91817744a202958808800544b783486 /src/mongo/db/pipeline/value.cpp | |
parent | 5bdf5d6b8995637193a37d04a0b816b71e47b9fb (diff) | |
download | mongo-20e9b2798d69fb2367ff9f16a1b30f4f9b73d93b.tar.gz |
SERVER-24638 Move command processing from Pipeline to AggregationRequest
Diffstat (limited to 'src/mongo/db/pipeline/value.cpp')
-rw-r--r-- | src/mongo/db/pipeline/value.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/db/pipeline/value.cpp b/src/mongo/db/pipeline/value.cpp index 37b3b88afae..4334af8260c 100644 --- a/src/mongo/db/pipeline/value.cpp +++ b/src/mongo/db/pipeline/value.cpp @@ -241,6 +241,15 @@ Value::Value(const BSONArray& arr) : _storage(Array) { _storage.putVector(vec.get()); } +Value::Value(const vector<BSONObj>& arr) : _storage(Array) { + intrusive_ptr<RCVector> vec(new RCVector); + vec->vec.reserve(arr.size()); + for (auto&& obj : arr) { + vec->vec.push_back(Value(obj)); + } + _storage.putVector(vec.get()); +} + Value Value::createIntOrLong(long long longValue) { int intValue = longValue; if (intValue != longValue) { |