diff options
author | David Storch <david.storch@10gen.com> | 2017-07-12 13:37:24 -0400 |
---|---|---|
committer | David Storch <david.storch@10gen.com> | 2017-07-17 16:21:14 -0400 |
commit | b86c6bcba36785122e4ad1d228e7a2a8602c40b4 (patch) | |
tree | e6573db10f1a603669eb121e4c4fc22e23a43882 /src/mongo/db/matcher/expression_parser.h | |
parent | d85cadf3e1bede6c726699e0dc81d3dbe2daefb7 (diff) | |
download | mongo-b86c6bcba36785122e4ad1d228e7a2a8602c40b4.tar.gz |
SERVER-29571 Parse a subset of $jsonSchema into a MatchExpression.
Adds support for $jsonSchema containing only the following
JSON Schema keywords:
- type
- properties
- maximum
Diffstat (limited to 'src/mongo/db/matcher/expression_parser.h')
-rw-r--r-- | src/mongo/db/matcher/expression_parser.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mongo/db/matcher/expression_parser.h b/src/mongo/db/matcher/expression_parser.h index 630f556e020..b6a7f9c21c6 100644 --- a/src/mongo/db/matcher/expression_parser.h +++ b/src/mongo/db/matcher/expression_parser.h @@ -82,6 +82,13 @@ public: */ static StatusWith<long long> parseIntegerElementToLong(BSONElement elem); + /** + * Given a path over which to match, and a type alias (e.g. "long", "number", or "object"), + * returns the corresponding $type match expression node. + */ + static StatusWith<std::unique_ptr<TypeMatchExpression>> parseTypeFromAlias( + StringData path, StringData typeAlias); + private: MatchExpressionParser(const ExtensionsCallback* extensionsCallback) : _extensionsCallback(extensionsCallback) {} @@ -203,10 +210,6 @@ private: StatusWithMatchExpression _parseInternalSchemaSingleIntegerArgument( const char* name, const BSONElement& elem) const; - - // The maximum allowed depth of a query tree. Just to guard against stack overflow. - static const int kMaximumTreeDepth; - // Performs parsing for the match extensions. We do not own this pointer - it has to live // as long as the parser is active. const ExtensionsCallback* _extensionsCallback; |