Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-19450

Change BSONElement::getGtLtOp() to use StringMap rather than a large if-else

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor - P4
    • Resolution: Fixed
    • None
    • 3.1.7
    • Querying
    • None
    • Fully Compatible
    • Quint Iteration 7

    Description

      BSONElement::getGtLtOp() is used in query parsing to map the field name of a BSONElement to a BSONObj::MatchType (an enum which lists $-prefixed operators in the query predicate language).

      Currently, the mapping is implemented as a large if-else if-else block. Instead, we should use a StringMap. This should make the code more readable, and probably faster.

      Attachments

        Issue Links

          Activity

            People

              qingyang.chen Qingyang Chen
              david.storch@mongodb.com David Storch
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: