Skip to content

MongoDB: JSON view and right sidebar unnecessarily escape forward slashes #2322

Closed

Description

@tyrival

What happened?

MongoDB string values containing forward slashes are displayed with unnecessary escaping (\/) in two places:

  1. The main result view after switching to JSON format.
  2. The right sidebar value/detail view for an object or array field.

For example, given this MongoDB document (Extended JSON):

{
  "_id": 1250619239118200832,
  "active": false,
  "createTime": {"$date": "2026-08-21T05:09:11.429Z"},
  "destinations": [
    {
      "topic": "device/state/up/122"
    }
  ]
}

The main JSON view displays the nested value as:

{
  "_id": 1250619239118200832,
  "active": false,
  "createTime": "2026-08-21T05:09:11Z",
  "destinations": [
    {
      "topic": "device\/state\/up\/122"
    }
  ]
}

The right sidebar also displays destinations as:

[
  {
    "topic": "device\/state\/up\/122"
  }
]

\/ is valid JSON, but escaping / is optional and makes paths, URLs, MQTT topics, and similar values harder to read and copy. The same value is shown correctly as device/state/up/122 in MongoDB.

Steps to reproduce

  1. Connect to MongoDB.
  2. Insert or query a document containing a nested object/array string with /, for example destinations[0].topic = "device/state/up/122".
  3. Open the collection in the table browser.
  4. Switch the main result view to JSON.
  5. Observe that the value is rendered as device\/state\/up\/122.
  6. Select the destinations field and inspect its value in the right sidebar.
  7. Observe the same unnecessary slash escaping there.

Expected behavior

Both display surfaces should preserve ordinary forward slashes:

"topic": "device/state/up/122"

JSON formatting used for user-visible output should use the equivalent of JSONSerialization.WritingOptions.withoutEscapingSlashes, while continuing to escape characters that JSON requires, such as quotes, backslashes, and control characters.

It would be useful to add regression coverage for nested object and array values in both the result JSON serializer and right-sidebar pretty-print path.

Database type

MongoDB

TablePro version

0.66.0 Debug, built from PR #2318 commit 84ee6bfe6eb1e70660cc34f7e2ba36f439c88d58; MongoDBDriver 1.0.39

macOS version & chip

macOS 26.6.2 (25G83), Apple Silicon arm64

Additional context

The issue affects presentation/copy readability in both the main JSON view and the right sidebar. This report is specifically about optional forward-slash escaping; the BSON date-to-ISO-string representation is shown only as part of the observed output and is not the focus of this issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions