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

ValueWriter cannot serialize scalar Symbol

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • ALL

      This ticket is follow-on work from SERVER-61234, which adds ValueWriter cases for scalar ObjectId, BinData, Timestamp, MinKey, MaxKey, and RegEx values.

      Adding support for Symbol would follow the same pattern as the other scalars, but there is no way to test the change in our jstests. The only ways to feed a scalar Symbol (a primitive Symbol value that is not part of an object or array) to the ValueWriter involve getting it out of the ValueReader, but the ValueReader automatically translates scalar Symbols into regular strings:
      https://github.com/mongodb/mongo/blob/581c58c475a872e25b2e3bf7cf5ccd52425ef7c7/src/mongo/scripting/mozjs/valuereader.cpp#L87-L90

      If we ever wish to remove the automatic Symbol->string conversion, we would need to also add scalar Symbol conversions similar to the conversions in SERVER-61234.

            Assignee:
            backlog-query-execution [DO NOT USE] Backlog - Query Execution
            Reporter:
            justin.seyster@mongodb.com Justin Seyster
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: