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

Refactor numeric type conversion out of BSON

    • Type: Icon: Task Task
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query 2020-11-30, Query 2020-12-14, Query 2020-12-28, Query 2021-01-11, Query 2021-01-25, Query Optimization 2021-02-22, Query Optimization 2021-03-08, Query Optimization 2021-03-22, Query Optimization 2021-04-05, Query Optimization 2021-04-19, Query Optimization 2021-05-03, Query Optimization 2021-05-17

      The existing query parsing system uses member functions on the BSON objects/elements representing the query to perform numeric type conversion when necessary as it builds the MatchExpression tree or pipeline.

      With the new CST + bison-based parser, we ideally remove the need for BSON at the initial parse, but often need to do type conversion afterwords (like during validation and translation). This means that to ensure we're doing conversions identically to the old code, we need to recreate temporary BSONObjs, which is annoying and has allocation overhead .

      When we get a chance, we should refactor the type-conversion operators on the BSON currently used in parsing to make them independent of the BSON (possibly as a library of free functions, allowing them to be used independently of BSON and to have the existing BSON methods delegate to them).

      cc jacob.evans david.percy

            Assignee:
            jacob.evans@mongodb.com Jacob Evans
            Reporter:
            george.wangensteen@mongodb.com George Wangensteen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: