summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2018-12-27 14:01:39 -0500
committerMathias Stearn <mathias@10gen.com>2019-03-07 17:27:08 -0500
commit470c14ed7543d62a2a76476e6522823316ec36d3 (patch)
treefcdc9a481d30e3f828fadc76ee7db551c02aad73
parentf2b20e43b4abd5dace54432676c539efb187b020 (diff)
downloadmongo-470c14ed7543d62a2a76476e6522823316ec36d3.tar.gz
SERVER-38038 mongo shell should support all ErrorExtraInfo codes
(cherry picked from commit 33c750267b6481c0d0320d75c94ef755f3e467fe)
-rw-r--r--src/mongo/SConscript1
-rw-r--r--src/mongo/db/pipeline/aggregation_request.cpp3
-rw-r--r--src/mongo/db/pipeline/aggregation_request.h3
-rw-r--r--src/mongo/db/views/SConscript12
-rw-r--r--src/mongo/shell/dbshell.cpp2
5 files changed, 16 insertions, 5 deletions
diff --git a/src/mongo/SConscript b/src/mongo/SConscript
index 4add4dabf69..e7259e563f7 100644
--- a/src/mongo/SConscript
+++ b/src/mongo/SConscript
@@ -523,6 +523,7 @@ if not has_option('noshell') and usemozjs:
"db/server_options_core",
"client/clientdriver_network",
"$BUILD_DIR/mongo/util/password",
+ "$BUILD_DIR/mongo/db/views/resolved_view",
],
LIBDEPS_PRIVATE=[
"$BUILD_DIR/mongo/client/connection_string",
diff --git a/src/mongo/db/pipeline/aggregation_request.cpp b/src/mongo/db/pipeline/aggregation_request.cpp
index 11b49f23dc0..7d213a6e084 100644
--- a/src/mongo/db/pipeline/aggregation_request.cpp
+++ b/src/mongo/db/pipeline/aggregation_request.cpp
@@ -65,9 +65,6 @@ constexpr StringData AggregationRequest::kCommentName;
constexpr long long AggregationRequest::kDefaultBatchSize;
-AggregationRequest::AggregationRequest(NamespaceString nss, std::vector<BSONObj> pipeline)
- : _nss(std::move(nss)), _pipeline(std::move(pipeline)), _batchSize(kDefaultBatchSize) {}
-
StatusWith<std::vector<BSONObj>> AggregationRequest::parsePipelineFromBSON(
BSONElement pipelineElem) {
std::vector<BSONObj> pipeline;
diff --git a/src/mongo/db/pipeline/aggregation_request.h b/src/mongo/db/pipeline/aggregation_request.h
index 7ef23b8734b..4f336461e55 100644
--- a/src/mongo/db/pipeline/aggregation_request.h
+++ b/src/mongo/db/pipeline/aggregation_request.h
@@ -104,7 +104,8 @@ public:
* Constructs an AggregationRequest over the given namespace with the given pipeline. All
* options aside from the pipeline assume their default values.
*/
- AggregationRequest(NamespaceString nss, std::vector<BSONObj> pipeline);
+ AggregationRequest(NamespaceString nss, std::vector<BSONObj> pipeline)
+ : _nss(std::move(nss)), _pipeline(std::move(pipeline)), _batchSize(kDefaultBatchSize) {}
/**
* Serializes the options to a Document. Note that this serialization includes the original
diff --git a/src/mongo/db/views/SConscript b/src/mongo/db/views/SConscript
index 8024e68c649..315fd179c1d 100644
--- a/src/mongo/db/views/SConscript
+++ b/src/mongo/db/views/SConscript
@@ -21,9 +21,9 @@ env.Library(
'view.cpp',
'view_catalog.cpp',
'view_graph.cpp',
- 'resolved_view.cpp',
],
LIBDEPS=[
+ 'resolved_view',
'$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/db/server_parameters',
'$BUILD_DIR/mongo/db/pipeline/aggregation',
@@ -32,6 +32,16 @@ env.Library(
]
)
+env.Library(
+ target='resolved_view',
+ source=[
+ 'resolved_view.cpp',
+ ],
+ LIBDEPS=[
+ '$BUILD_DIR/mongo/base',
+ ]
+)
+
env.CppUnitTest(
target='views_test',
source=[
diff --git a/src/mongo/shell/dbshell.cpp b/src/mongo/shell/dbshell.cpp
index 3fc5b2c69b5..8283793328b 100644
--- a/src/mongo/shell/dbshell.cpp
+++ b/src/mongo/shell/dbshell.cpp
@@ -765,6 +765,8 @@ int _main(int argc, char* argv[], char** envp) {
// hide password from ps output
redactPasswordOptions(argc, argv);
+ ErrorExtraInfo::invariantHaveAllParsers();
+
if (!mongo::serverGlobalParams.quiet.load())
cout << mongoShellVersion(VersionInfoInterface::instance()) << endl;