diff options
author | Nick Zolnierz <nicholas.zolnierz@mongodb.com> | 2017-08-24 13:23:41 -0400 |
---|---|---|
committer | Nick Zolnierz <nicholas.zolnierz@mongodb.com> | 2017-09-19 13:47:58 -0400 |
commit | 4574a7c8dd12650eceee1e197b35ba47dfbb7f8e (patch) | |
tree | 9709578bb7347d0395e900b7ccace7b4cb5c156d /src/mongo/db/pipeline/value.cpp | |
parent | af7387affece778a2507666b8bc5f502778fe1b8 (diff) | |
download | mongo-4574a7c8dd12650eceee1e197b35ba47dfbb7f8e.tar.gz |
SERVER-30176: Extend the JSON Schema parser to handle logical restriction keywords (enum only)
Diffstat (limited to 'src/mongo/db/pipeline/value.cpp')
-rw-r--r-- | src/mongo/db/pipeline/value.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mongo/db/pipeline/value.cpp b/src/mongo/db/pipeline/value.cpp index a7bce3fc777..2695da381d0 100644 --- a/src/mongo/db/pipeline/value.cpp +++ b/src/mongo/db/pipeline/value.cpp @@ -648,7 +648,7 @@ inline static int cmp(const T& left, const T& right) { int Value::compare(const Value& rL, const Value& rR, const StringData::ComparatorInterface* stringComparator) { - // Note, this function needs to behave identically to BSON's compareElementValues(). + // Note, this function needs to behave identically to BSONElement::compareElements(). // Additionally, any changes here must be replicated in hash_combine(). BSONType lType = rL.getType(); BSONType rType = rR.getType(); @@ -660,7 +660,8 @@ int Value::compare(const Value& rL, return ret; switch (lType) { - // Order of types is the same as in compareElementValues() to make it easier to verify + // Order of types is the same as in BSONElement::compareElements() to make it easier to + // verify. // These are valueless types case EOO: @@ -802,7 +803,9 @@ int Value::compare(const Value& rL, return rL.getStringData().compare(rR.getStringData()); } - case RegEx: // same as String in this impl but keeping order same as compareElementValues + case RegEx: + // same as String in this impl but keeping order same as + // BSONElement::compareElements(). return rL.getStringData().compare(rR.getStringData()); case CodeWScope: { @@ -826,7 +829,7 @@ void Value::hash_combine(size_t& seed, boost::hash_combine(seed, canonicalizeBSONType(type)); switch (type) { - // Order of types is the same as in Value::compare() and compareElementValues(). + // Order of types is the same as in Value::compare() and BSONElement::compareElements(). // These are valueless types case EOO: |