-
Type: Bug
-
Resolution: Won't Fix
-
Priority: 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.
- related to
-
SERVER-61234 JS object-based types are not properly auto-serialized when directly returned by server-side JS functions
- Closed