You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MongoDB query result export should use flattened columns like the SQL Editor table view #20923
The exported file should follow the same flattened structure as the table view.
This affects CSV, XLSX, and JSON exports.
Steps to reproduce
Connect Bytebase to a MongoDB database.
Open the SQL Editor.
Run a query that returns MongoDB documents, for example:
db.devices.find({})
Confirm that the SQL Editor table view displays each document field as a separate column.
Export the result as CSV.
Export the same result as XLSX.
Export the same result as JSON.
Open the exported files.
Observe that the result contains a single result column and each row contains the whole MongoDB document as a JSON string.
Expected behavior
MongoDB query result exports should use the same flattened columns shown in the SQL Editor table view.
For CSV, the output should contain a header row and one field per column:
Missing fields should be exported as empty or null cells depending on the export format.
Nested MongoDB documents and arrays can remain as compact JSON values inside a single cell, matching how they are displayed in the SQL Editor table.
Provide the database you are using
Mongodb 7.x and 8.x
Additional context
The MongoDB backend currently returns query results as a single column named result. Each row contains one Relaxed Extended JSON document.
The SQL Editor applies MongoDB result flattening only in the frontend for the table view. The export flow runs the query again on the backend and sends the original single-column result directly to the shared CSV, XLSX, and JSON writers.
Activity
h3n4l commentedon Jul 17, 2026
We had filed an internal issue BYT-9899 to track this. We will carefully investigate this feature request and let you know once we have any progress.