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

Fast bsonExtract handling for NoSuchKey + no default, in non-error case

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Query
    • Platforms 2017-06-19

      The bsonExtract* methods in bsonExtract.cpp are often used to both determine whether a field exists and in the case it does parse out of a BSONObj, with both results being considered valid. In the case where a field does not exist we generate an error Status object and build an error message using str::stream() both of which are expensive operations for a non-error path.

      We should consider adding methods (or modifying current ones) to support extraction or fast NoSuchKey return in the case the field doesn't exist (without return of an error Status object). This ticket should focus on the methods outside of the "WithDefault" ones, which will be handled under SERVER-27263.

      After completing this ticket we should perform an audit of the code base and enter follow-on tickets to address cases where NoSuchKey is being handled after bsonin a non-error situation. A few (out of many) examples of this:

      1. extensions_callback.cpp
      2. collator_factory_icu.cpp
      3. replset_commands.cpp

            Assignee:
            backlog-server-query Backlog - Query Team (Inactive)
            Reporter:
            james.wahlin@mongodb.com James Wahlin
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: