diff options
author | Ted Tuckman <ted.tuckman@mongodb.com> | 2020-07-24 08:13:44 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-08-04 18:32:24 +0000 |
commit | 4c4ce2bb432dacd0e771a9eae1572c86e7e0519b (patch) | |
tree | 2daf14d0ff5656d059c321e51acc04b4fe9825dc /src/mongo/db/cst/bson_lexer.cpp | |
parent | 0e3bd22e59a51dcdfc7fdac6d96dcda22e2e6647 (diff) | |
download | mongo-4c4ce2bb432dacd0e771a9eae1572c86e7e0519b.tar.gz |
SERVER-48861 Add arithmetic expressions to grammar
Diffstat (limited to 'src/mongo/db/cst/bson_lexer.cpp')
-rw-r--r-- | src/mongo/db/cst/bson_lexer.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mongo/db/cst/bson_lexer.cpp b/src/mongo/db/cst/bson_lexer.cpp index 3d8c5683783..6e8c4088615 100644 --- a/src/mongo/db/cst/bson_lexer.cpp +++ b/src/mongo/db/cst/bson_lexer.cpp @@ -80,6 +80,21 @@ const StringMap<PipelineParserGen::token_type> reservedKeyLookup = { {"$toObjectId", PipelineParserGen::token::TO_OBJECT_ID}, {"$toString", PipelineParserGen::token::TO_STRING}, {"$type", PipelineParserGen::token::TYPE}, + {"$abs", PipelineParserGen::token::ABS}, + {"$ceil", PipelineParserGen::token::CEIL}, + {"$divide", PipelineParserGen::token::DIVIDE}, + {"$exp", PipelineParserGen::token::EXPONENT}, + {"$floor", PipelineParserGen::token::FLOOR}, + {"$ln", PipelineParserGen::token::LN}, + {"$log", PipelineParserGen::token::LOG}, + {"$log10", PipelineParserGen::token::LOGTEN}, + {"$mod", PipelineParserGen::token::MOD}, + {"$multiply", PipelineParserGen::token::MULTIPLY}, + {"$pow", PipelineParserGen::token::POW}, + {"$round", PipelineParserGen::token::ROUND}, + {"$sqrt", PipelineParserGen::token::SQRT}, + {"$subtract", PipelineParserGen::token::SUBTRACT}, + {"$trunc", PipelineParserGen::token::TRUNC}, }; bool isCompound(PipelineParserGen::symbol_type token) { return token.type_get() == static_cast<int>(PipelineParserGen::token::START_OBJECT) || |