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

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

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.1.7
    • Affects Version/s: None
    • Component/s: Querying
    • None
    • Fully Compatible
    • Quint Iteration 7

      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.

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

              Created:
              Updated:
              Resolved: