diff options
author | Henrik Edin <henrik.edin@mongodb.com> | 2019-05-10 13:08:16 -0400 |
---|---|---|
committer | Henrik Edin <henrik.edin@mongodb.com> | 2019-05-10 13:08:16 -0400 |
commit | c34bc93a15cbb6fe8b222f12afac5adbab6f0737 (patch) | |
tree | 73dfb5e8a30e14a079abcb8b485ef8881a4db316 /src/mongo/db/pipeline/document_source_add_fields.cpp | |
parent | 5ec2e2508bec5cc64ea36f01f502c756c3e84597 (diff) | |
download | mongo-c34bc93a15cbb6fe8b222f12afac5adbab6f0737.tar.gz |
Revert "SERVER-40238 New stage alias: $set => $addFields"
This reverts commit bf6c2696da7eb207c28e83f5bb7401c97b0f69ac.
Diffstat (limited to 'src/mongo/db/pipeline/document_source_add_fields.cpp')
-rw-r--r-- | src/mongo/db/pipeline/document_source_add_fields.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/mongo/db/pipeline/document_source_add_fields.cpp b/src/mongo/db/pipeline/document_source_add_fields.cpp index 319ef9776c6..e95d420ac4d 100644 --- a/src/mongo/db/pipeline/document_source_add_fields.cpp +++ b/src/mongo/db/pipeline/document_source_add_fields.cpp @@ -45,33 +45,27 @@ using parsed_aggregation_projection::ParsedAddFields; REGISTER_DOCUMENT_SOURCE(addFields, LiteParsedDocumentSourceDefault::parse, DocumentSourceAddFields::createFromBson); -REGISTER_DOCUMENT_SOURCE(set, - LiteParsedDocumentSourceDefault::parse, - DocumentSourceAddFields::createFromBson); intrusive_ptr<DocumentSource> DocumentSourceAddFields::create( - BSONObj addFieldsSpec, const intrusive_ptr<ExpressionContext>& expCtx, StringData stageName) { + BSONObj addFieldsSpec, const intrusive_ptr<ExpressionContext>& expCtx) { const bool isIndependentOfAnyCollection = false; intrusive_ptr<DocumentSourceSingleDocumentTransformation> addFields( new DocumentSourceSingleDocumentTransformation( expCtx, ParsedAddFields::create(expCtx, addFieldsSpec), - stageName.toString(), + "$addFields", isIndependentOfAnyCollection)); return addFields; } intrusive_ptr<DocumentSource> DocumentSourceAddFields::createFromBson( BSONElement elem, const intrusive_ptr<ExpressionContext>& expCtx) { - const auto specifiedName = elem.fieldNameStringData(); - invariant(specifiedName == kStageName || specifiedName == kAliasNameSet); - uassert(40272, - str::stream() << specifiedName << " specification stage must be an object, got " + str::stream() << "$addFields specification stage must be an object, got " << typeName(elem.type()), elem.type() == Object); - return DocumentSourceAddFields::create(elem.Obj(), expCtx, specifiedName); + return DocumentSourceAddFields::create(elem.Obj(), expCtx); } } |