diff options
author | yarai <yuta.arai@10gen.com> | 2018-09-12 14:43:56 -0400 |
---|---|---|
committer | yarai <yuta.arai@10gen.com> | 2018-09-21 15:46:34 -0400 |
commit | fc75cfdf2e8f97572efd97a348893ba08a82276a (patch) | |
tree | 2a9538ab5b6158a039b7f8be7bd67c25d6f9514b /src/mongo/db/exec/index_scan.cpp | |
parent | 92b9046433bf8a50dae15f733485adb859d7ed72 (diff) | |
download | mongo-fc75cfdf2e8f97572efd97a348893ba08a82276a.tar.gz |
SERVER-36931 Handle returnKey option for $** indexes
Diffstat (limited to 'src/mongo/db/exec/index_scan.cpp')
-rw-r--r-- | src/mongo/db/exec/index_scan.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/db/exec/index_scan.cpp b/src/mongo/db/exec/index_scan.cpp index 45f45da73f4..a4836e6e5a2 100644 --- a/src/mongo/db/exec/index_scan.cpp +++ b/src/mongo/db/exec/index_scan.cpp @@ -38,6 +38,7 @@ #include "mongo/db/exec/scoped_timer.h" #include "mongo/db/exec/working_set_computed_data.h" #include "mongo/db/index/index_access_method.h" +#include "mongo/db/index_names.h" #include "mongo/db/query/index_bounds_builder.h" #include "mongo/stdx/memory.h" #include "mongo/util/log.h" @@ -218,9 +219,8 @@ PlanStage::StageState IndexScan::doWork(WorkingSetID* out) { _workingSet->transitionToRecordIdAndIdx(id); if (_params.addKeyMetadata) { - BSONObjBuilder bob; - bob.appendKeys(_keyPattern, kv->key); - member->addComputed(new IndexKeyComputedData(bob.obj())); + member->addComputed( + new IndexKeyComputedData(IndexKeyComputedData::rehydrateKey(_keyPattern, kv->key))); } *out = id; |