summaryrefslogtreecommitdiff
path: root/src/mongo/db/exec/projection_exec.cpp
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2014-04-28 16:39:33 -0400
committerDavid Storch <david.storch@10gen.com>2014-05-01 09:17:40 -0400
commit10d8b3d7984a4abf0d8f80562d426d2f5f0707c3 (patch)
tree44707d2d393fe693955224a62503e0c509373cd3 /src/mongo/db/exec/projection_exec.cpp
parent5b4ad3281493f6fcdccf96781237e79a13b59621 (diff)
downloadmongo-10d8b3d7984a4abf0d8f80562d426d2f5f0707c3.tar.gz
SERVER-13337 support queries with projections in the idhack runner
Diffstat (limited to 'src/mongo/db/exec/projection_exec.cpp')
-rw-r--r--src/mongo/db/exec/projection_exec.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mongo/db/exec/projection_exec.cpp b/src/mongo/db/exec/projection_exec.cpp
index afa60132631..27eed3f90d4 100644
--- a/src/mongo/db/exec/projection_exec.cpp
+++ b/src/mongo/db/exec/projection_exec.cpp
@@ -347,8 +347,16 @@ namespace mongo {
}
Status ProjectionExec::transform(const BSONObj& in, BSONObj* out) const {
+ // If it's a positional projection we need a MatchDetails.
+ MatchDetails matchDetails;
+ if (transformRequiresDetails()) {
+ matchDetails.requestElemMatchKey();
+ verify(NULL != _queryExpression);
+ verify(_queryExpression->matchesBSON(in, &matchDetails));
+ }
+
BSONObjBuilder bob;
- Status s = transform(in, &bob, NULL);
+ Status s = transform(in, &bob, &matchDetails);
if (!s.isOK()) {
return s;
}