summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests/documentsourcetests.cpp
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2012-12-06 12:20:54 -0500
committerMathias Stearn <mathias@10gen.com>2012-12-10 18:54:05 -0500
commitcb7bd2463a04d9e5716c55584b19d3d8acb8a6c4 (patch)
treef7207699921123dc6f88dbe696452e0420ce5354 /src/mongo/dbtests/documentsourcetests.cpp
parent459467c7cf47b57d8990eeb41c65b4e203e15b65 (diff)
downloadmongo-cb7bd2463a04d9e5716c55584b19d3d8acb8a6c4.tar.gz
Optimize ExpressionFieldPath and give better semantics
Diffstat (limited to 'src/mongo/dbtests/documentsourcetests.cpp')
-rw-r--r--src/mongo/dbtests/documentsourcetests.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mongo/dbtests/documentsourcetests.cpp b/src/mongo/dbtests/documentsourcetests.cpp
index e4dc5519f73..4ce3c9e2385 100644
--- a/src/mongo/dbtests/documentsourcetests.cpp
+++ b/src/mongo/dbtests/documentsourcetests.cpp
@@ -1389,11 +1389,14 @@ namespace DocumentSourceTests {
}
};
- /** A missing nested object within an array is not supported. */
- class MissingObjectWithinArray : public InvalidOperationBase {
+ /** A missing nested object within an array returns an empty array. */
+ class MissingObjectWithinArray : public CheckResultsBase {
void populateData() {
client.insert( ns, BSON( "_id" << 0 << "a" << BSON_ARRAY( 1 ) ) );
- client.insert( ns, BSON( "_id" << 1 << "a" << BSON_ARRAY( 0 ) ) );
+ client.insert( ns, BSON( "_id" << 1 << "a" << BSON_ARRAY( BSON("b" << 1) ) ) );
+ }
+ string expectedResultSetString() {
+ return "[{_id:0,a:[1]},{_id:1,a:[{b:1}]}]";
}
BSONObj sortSpec() { return BSON( "a.b" << 1 ); }
};