summaryrefslogtreecommitdiff
path: root/jstests/aggregation/sources/graphLookup/error.js
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2016-10-03 11:17:13 -0400
committerDavid Storch <david.storch@10gen.com>2016-10-03 16:13:51 -0400
commit8758a5c7be68effbc4a1f857787bfb7b201c6389 (patch)
tree4880b453167dcada211c278dbc34ff095e31d81c /jstests/aggregation/sources/graphLookup/error.js
parentb8a5742ef7623640eb6977f14e25649bad661208 (diff)
downloadmongo-8758a5c7be68effbc4a1f857787bfb7b201c6389.tar.gz
SERVER-25038 add LiteParsedPipeline
This provides a way to do pre-parse validity checks. Full parsing of the Pipeline must be done under the collection lock, when the collation is known.
Diffstat (limited to 'jstests/aggregation/sources/graphLookup/error.js')
-rw-r--r--jstests/aggregation/sources/graphLookup/error.js20
1 files changed, 17 insertions, 3 deletions
diff --git a/jstests/aggregation/sources/graphLookup/error.js b/jstests/aggregation/sources/graphLookup/error.js
index 2728e1abd75..a686fb30945 100644
--- a/jstests/aggregation/sources/graphLookup/error.js
+++ b/jstests/aggregation/sources/graphLookup/error.js
@@ -9,7 +9,10 @@ load("jstests/aggregation/extras/utils.js"); // For "assertErrorCode".
local.drop();
local.insert({});
- var pipeline = {
+ var pipeline = {$graphLookup: 4};
+ assertErrorCode(local, pipeline, 40327, "$graphLookup spec must be an object");
+
+ pipeline = {
$graphLookup: {
from: "foreign",
startWith: {$literal: 0},
@@ -54,7 +57,18 @@ load("jstests/aggregation/extras/utils.js"); // For "assertErrorCode".
as: "output"
}
};
- assertErrorCode(local, pipeline, 40103, "from must be a string");
+ assertErrorCode(local, pipeline, 40329, "from must be a string");
+
+ pipeline = {
+ $graphLookup: {
+ from: "",
+ startWith: {$literal: 0},
+ connectToField: "a",
+ connectFromField: "b",
+ as: "output"
+ }
+ };
+ assertErrorCode(local, pipeline, 40330, "from must be a valid namespace");
pipeline = {
$graphLookup: {
@@ -201,7 +215,7 @@ load("jstests/aggregation/extras/utils.js"); // For "assertErrorCode".
$graphLookup:
{startWith: {$literal: 0}, connectToField: "a", connectFromField: "b", as: "output"}
};
- assertErrorCode(local, pipeline, 40105, "from was not specified");
+ assertErrorCode(local, pipeline, 40328, "from was not specified");
// restrictSearchWithMatch must be a valid match expression.
pipeline = {