summaryrefslogtreecommitdiff
path: root/db/projection.cpp
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-11-16 11:24:44 -0500
committerEliot Horowitz <eliot@10gen.com>2010-11-16 14:44:39 -0500
commit598af81eaa74d1ee0a398b48f3c8174c7e643098 (patch)
tree15b04721df2cfdc0d59c8cfe90ca32bd33beb71e /db/projection.cpp
parent7f0b3ac99cf014112ff261a92b88c30616ca61d4 (diff)
downloadmongo-598af81eaa74d1ee0a398b48f3c8174c7e643098.tar.gz
safety for Projection's current state SERVER-192 SERVER-2104
Diffstat (limited to 'db/projection.cpp')
-rw-r--r--db/projection.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/db/projection.cpp b/db/projection.cpp
index 85bb5463503..4b1fa821f88 100644
--- a/db/projection.cpp
+++ b/db/projection.cpp
@@ -238,8 +238,15 @@ namespace mongo {
BSONObjIterator i( keyPattern );
while ( i.more() ){
BSONElement k = i.next();
-
+
if ( _source[k.fieldName()].type() ){
+
+ if ( strchr( k.fieldName() , '.' ) ){
+ // TODO we currently don't support dotted fields
+ // SERVER-2104
+ return 0;
+ }
+
if ( ! _includeID && mongoutils::str::equals( k.fieldName() , "_id" ) ){
p->addNo();
}