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

ValueWriter cannot serialize scalar Symbol

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Won't Fix
    • None
    • None
    • None
    • None
    • Query Execution
    • ALL

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              backlog-query-execution Backlog - Query Execution
              justin.seyster@mongodb.com Justin Seyster
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: