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

Invalid output of tojson() for Set and Map objects

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 8.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • Fully Compatible
    • ALL
    • QE 2025-02-17

      For legacy reasons tojson() output does not produce valid JSON, but some serialization of objects that is expected to be evaluable.

      Currently, tojson(new Set([1, 2])) returns [1, 2], which evaluates to Array, but it should rather be "new Set([1, 2])". The same is with Map instances.

            Assignee:
            daniel.tabacaru@mongodb.com Daniel Tabacaru
            Reporter:
            romans.kasperovics@mongodb.com Romans Kasperovics
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: