Add an option to pass JSON attributes to assert functions

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Query Execution
    • Fully Compatible
    • QE 2025-02-17
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      Even though SERVER-96944 introduces JSON output format to assert functions, however, many assert invocations add objects to the message, e.g.:

      assert.eq(1, docs.length, "unexpected number of documents : " + tojson(docs));
      

      This would serialize 'docs' into a string, which is undesirable. A better alternative:

      assert.eq(1, docs.length, "unexpected number of documents", {docs});
      

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

              Created:
              Updated:
              Resolved: