diff options
author | Jacob Evans <jacob.evans@mongodb.com> | 2019-09-10 22:58:06 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-09-10 22:58:06 +0000 |
commit | ec7207615f975d04392ea7cb3fba4d6d0cfe1a6c (patch) | |
tree | 6afa6ab6d4f3c55c77ab6eea6ab504f146a2ab30 /src/mongo/db/pipeline/pipeline_d.h | |
parent | 42f6c0aeb341b1b0d2b6bbcea15acf35086a038c (diff) | |
download | mongo-ec7207615f975d04392ea7cb3fba4d6d0cfe1a6c.tar.gz |
SERVER-43013 Translate Map Reduce to Agg Pipeline
Diffstat (limited to 'src/mongo/db/pipeline/pipeline_d.h')
-rw-r--r-- | src/mongo/db/pipeline/pipeline_d.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mongo/db/pipeline/pipeline_d.h b/src/mongo/db/pipeline/pipeline_d.h index 45bd9218484..606c91a1067 100644 --- a/src/mongo/db/pipeline/pipeline_d.h +++ b/src/mongo/db/pipeline/pipeline_d.h @@ -38,6 +38,7 @@ #include "mongo/db/pipeline/dependencies.h" #include "mongo/db/pipeline/document_source_cursor.h" #include "mongo/db/pipeline/document_source_group.h" +#include "mongo/db/query/collation/collator_factory_interface.h" #include "mongo/db/query/plan_executor.h" namespace mongo { @@ -129,7 +130,16 @@ public: */ static std::unique_ptr<CollatorInterface> resolveCollator(OperationContext* opCtx, BSONObj userCollation, - const Collection* collection); + const Collection* collection) { + if (!userCollation.isEmpty()) { + return uassertStatusOK(CollatorFactoryInterface::get(opCtx->getServiceContext()) + ->makeFromBSON(userCollation)); + } + + return (collection && collection->getDefaultCollator() + ? collection->getDefaultCollator()->clone() + : nullptr); + } private: PipelineD(); // does not exist: prevent instantiation |