Improve logging of undefined values and properties in jstests

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Minor - P4
    • 8.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Query Execution
    • Fully Compatible
    • QE 2025-03-03, QE 2025-03-17
    • 200
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      'undefined' value is not a part of JSON specification, but it is still useful to see which values and properties are undefined. The output should be valid JSON, therefore we should consider the following serialization for logs:

      toJsonForLog(undefined) --> {"$undefined": true} // currently prints undefined
      toJsonForLog([undefined]) --> [{"$undefined": true}] // currently prints [null]
      toJsonForLog({hello: undefined}) --> {"hello":{"$undefined": true}} // currently prints {}
      

            Assignee:
            Daniel Tabacaru
            Reporter:
            Romans Kasperovics
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: