Export Data - JSON, CSV, SQL
Create and manage individual export/import jobs with advanced configuration options. Configure source, target, field mapping, and transformation scripts for data migration between MongoDB, SQL databases, and file formats (JSON, CSV, BSON, SQL).
Create and execute your first export job in just a few steps:
Each export/import job consists of three main configuration areas: Source, Target, and Data Transformation.
Define where your data comes from. VisualLeaf supports multiple source types for maximum flexibility.
| Source Type | Description | Configuration Options |
|---|---|---|
MongoDB Collection |
Export all documents from a specific collection | Connection, database, collection |
MongoDB Query |
Export filtered data using MongoDB query syntax | Query filter, projection, sort, limit, skip |
MongoDB Aggregation |
Export data processed through aggregation pipeline | Pipeline stages, $match, $group, $lookup, etc. |
MongoDB Database |
Export entire database with all collections | Connection, database, folder path for output |
MongoDB Script |
Execute custom MongoDB shell script as source | Connection, database, JavaScript code |
MongoDump |
Import from MongoDB dump files (BSON format) | Folder path containing BSON files |
SQL Table |
Export data from a SQL database table | SQL connection, database, table name |
SQL Query |
Export data using custom SQL SELECT statement | SQL connection, custom SELECT query |
JSON |
Import from JSON file (array or line-delimited) | File path, format detection (auto) |
CSV |
Import from CSV file with configurable delimiters | File path, delimiter, has header row |
Notification |
Send notification only (no data export) | Notification settings |
Choose where to export your data. Each target type has specific configuration options.
| Target Type | Description | Configuration Options |
|---|---|---|
JSON |
Export to JSON file (array or line-delimited) | File path, format, pretty print, UTF-8 encoding |
CSV |
Export to CSV file with custom delimiters | File path, delimiter, header row, encoding |
MongoDB Export (BSON) |
Export to MongoDB BSON format (mongoexport) | File/folder path, compression options |
MongoDB Collection |
Export directly to another MongoDB collection | Connection, database, collection, write mode |
SQL Script |
Generate SQL INSERT/UPDATE statements | File path, SQL dialect, batch size, transaction mode |
SQL Database |
Export directly to SQL database table | SQL connection, table, write mode, create table |
Transform your data during export/import with powerful field mapping and JavaScript transformation scripts. Perfect for data cleansing, format conversion, and schema adaptation.
Map source fields to target fields with automatic type detection and manual override options. The field mapper shows a live preview of your data transformation.
Write custom JavaScript functions to transform field values during export/import. Each field can have its own transformation script.
Script Context: Your transformation scripts have access to these variables:
value - The current field valuedoc - The entire source documenttarget - The target document being builtindex - Document index in the batch// Convert string to uppercase
return value?.toString().toUpperCase();
// Parse date string to Date object
return new Date(value);
// Combine multiple fields
return `${doc.firstName} ${doc.lastName}`;
// Conditional transformation
return value > 100 ? 'high' : 'low';
// Array transformation
return value?.map(item => item.id);
Before running your export/import job, preview the transformation results on sample data. The preview shows both the original and transformed documents side-by-side.
Track the progress of running export/import jobs in real-time with detailed status updates and error reporting via Server-Sent Events (SSE).
| Status | Description |
|---|---|
| Pending | Job is queued and waiting to start |
| Running | Job is currently executing |
| Completed | Job finished successfully |
| Failed | Job encountered an error and stopped |
| Cancelled | Job was manually stopped by user |
Run the export/import job immediately. The job automatically saves before execution, then starts processing. Monitor progress in real-time with SSE updates. Success toast notification shown on completion.
Save the job configuration. After saving, you'll be prompted: "Do you want to go to the Job Manager?" Choose "Yes" to navigate to Task Manager, or "No" to close. Use Ctrl+S (Cmd+S on Mac) as a shortcut.
Test your transformation scripts and field mappings on sample data (up to 100 documents) before running the full job. Shows side-by-side comparison of source and transformed documents with validation errors highlighted.
Automatically creates a descriptive job name based on source and target configuration (e.g., "users_collection_to_csv", "mongodb_to_mysql_migration"). Click the magic wand icon in the job title.
Close the job configuration without saving changes. Press Escape key as a shortcut (unless editing the job name). For modal mode, closes the modal. For embedded mode, returns to previous view.
| Shortcut | Action |
|---|---|
| Ctrl+S (or Cmd+S on Mac) | Save job configuration |
| Esc | Close job configuration (cancel) |
Download and start managing your MongoDB databases with ease.
Download Free Trial