Documentation

Collection View

Collection View

The Collection View is your primary interface for browsing, viewing, and analyzing documents in MongoDB collections. It offers three distinct viewing modes—Tree View, Table View, and BSON View—each optimized for different use cases. Master the keyboard shortcuts to navigate efficiently through your data.

Quick Start

Open a collection and switch between viewing modes:

  1. In the sidebar, click on any collection to open it
  2. The Collection View opens in Tree View by default
  3. Press Ctrl + 1 for Tree View, Ctrl + 2 for Table View, or Ctrl + 3 for BSON View
  4. Use Ctrl + F to search within documents
  5. Press F5 to refresh and reload documents

Keyboard Shortcuts

Master these keyboard shortcuts to navigate the Collection View efficiently:

View Mode Switching

Shortcut Action Description
Ctrl + 1 Switch to Tree View Display documents in expandable tree structure
Ctrl + 2 Switch to Table View Display documents in spreadsheet-like table
Ctrl + 3 Switch to BSON View Display raw BSON/JSON representation
Shortcut Action Description
↑ / ↓ Navigate documents Move up/down through document list
Page Up / Page Down Fast scroll Jump through multiple documents at once
Home First document Jump to the first document in the list
End Last document Jump to the last loaded document
Ctrl + A Select all Select all visible documents (Table View)
Shift + Click Range select Select range of documents (Table View)
Ctrl + Click Multi-select Add/remove documents from selection

Document Operations

Shortcut Action Description
Ctrl + N New document Open editor to create a new document
Ctrl + E Edit document Open selected document in editor
Ctrl + D Duplicate document Create a copy of selected document
Delete Delete document Delete selected document(s) with confirmation
Ctrl + C Copy document Copy document JSON to clipboard
Ctrl + V Paste document Insert document from clipboard JSON
Enter View/Edit document Open document in edit mode (double-click alternative)

Search & Filter

Shortcut Action Description
Ctrl + F Find in documents Open search panel to find text within documents
Ctrl + G Find next Jump to next search result
Ctrl + Shift + G Find previous Jump to previous search result
Esc Clear search Close search panel and clear highlights

View Controls

Shortcut Action Description
F5 Refresh Reload documents from database
Ctrl + + Zoom in Increase font size in view
Ctrl + - Zoom out Decrease font size in view
Ctrl + 0 Reset zoom Reset font size to default
Ctrl + B Toggle sidebar Show/hide the database sidebar

Tree View Specific

Shortcut Action Description
Expand node Expand selected tree node to show children
Collapse node Collapse selected tree node to hide children
Ctrl + → Expand all Recursively expand all nodes in document
Ctrl + ← Collapse all Collapse all nodes in document to root level
Space Toggle expansion Toggle expand/collapse of current node

Pro Tip

Press Ctrl + / to display the keyboard shortcuts help overlay anytime. The overlay shows context-specific shortcuts based on your current view mode and selected elements.

Tree View

Tree View displays documents in an expandable hierarchical structure, making it ideal for exploring nested objects and arrays. Each field is displayed as a node that can be expanded or collapsed, allowing you to focus on the data you need.

Tree View Features

Hierarchical Navigation

Explore nested documents with expandable/collapsible nodes. See the full structure at a glance.

Type Indicators

Visual icons show data types: objects, arrays, strings, numbers, dates, ObjectIds, and more.

Lazy Loading

Large arrays and deeply nested objects load on-demand to maintain performance.

Copy Field Path

Right-click any field to copy its dot-notation path (e.g., user.address.city).

Inline Editing

Click any value to edit it inline. Changes are validated and saved immediately.

Search Highlighting

Search results are highlighted within the tree, with matching nodes auto-expanded.

Understanding Tree View Structure

Each node in the tree displays:

  • Expand/Collapse Icon - Triangle icon to toggle node visibility (▶ collapsed, ▼ expanded)
  • Type Icon - Visual indicator of data type (📄 object, 📋 array, "abc" string, 123 number, etc.)
  • Field Name - The key name in the document (colored based on type)
  • Field Value - The actual value, with syntax highlighting
  • Array/Object Count - Number of items in arrays or fields in objects (shown in gray)

Data Type Visualization

Tree View uses color coding and icons to distinguish data types:

Type Icon Color Example
Object 📄 White { name: "John", age: 30 }
Array 📋 Yellow [1, 2, 3, 4, 5]
String "abc" Green "Hello World"
Number 123 Blue 42, 3.14
Boolean ✓/✗ Orange true, false
Date 📅 Purple ISODate("2026-04-02")
ObjectId 🔑 Cyan ObjectId("507f1f77bcf86cd799439011")
Null Gray null
Binary 📦 Pink BinData(0, "...")

Working with Arrays

Arrays in Tree View are displayed with special handling:

  • Array Index - Each item shows its zero-based index: [0], [1], [2]
  • Item Count - Array nodes show total item count: items (25)
  • Pagination - Large arrays (>100 items) are paginated with "Load More" buttons
  • Mixed Types - Arrays with different types show type icons for each item
  • Nested Arrays - Multi-dimensional arrays can be expanded recursively

Context Menu Actions

Right-click any field in Tree View to access these actions:

  • Copy Field Name - Copy the field key to clipboard
  • Copy Field Path - Copy dot-notation path (e.g., user.profile.email)
  • Copy Field Value - Copy the value as JSON
  • Copy as MongoDB Query - Generate query filter for this field/value pair
  • Edit Value - Open inline editor to modify the value
  • Delete Field - Remove this field from the document
  • Add Field - Add a new sibling field at this level
  • Expand All Children - Recursively expand all nested nodes
  • Collapse All Children - Collapse all nested nodes
Video COLLECTION_VIEW_TREE_VIDEO_01 Tree View Tutorial - Navigate nested documents, expand/collapse nodes, use context menus, edit values inline, and copy field paths

Table View

Table View displays documents in a spreadsheet-like format with rows and columns, perfect for comparing values across documents and performing bulk operations. Each unique field in your documents becomes a column, allowing you to see patterns and outliers at a glance.

Table View Features

Spreadsheet Layout

Familiar grid interface with rows (documents) and columns (fields) for easy comparison.

Column Sorting

Click column headers to sort ascending/descending. Multi-column sort with Shift+Click.

Column Resizing

Drag column borders to adjust width. Double-click border to auto-fit content.

Column Reordering

Drag column headers to rearrange. Your layout is saved per collection.

Column Hiding

Right-click headers to show/hide columns. Focus on relevant fields only.

Bulk Selection

Select multiple rows with Shift+Click or Ctrl+Click for batch operations.

Cell Editing

Double-click any cell to edit. Tab/Enter to navigate between cells.

Export to CSV

Export visible columns and selected rows to CSV for external analysis.

Understanding Table View Layout

The table is organized as follows:

  • Header Row - Field names with sort indicators and menu access
  • Data Rows - One row per document, alternating row colors for readability
  • Selection Column - Leftmost column with checkboxes for multi-select
  • _id Column - Always first data column, shows document ObjectId
  • Field Columns - Automatically detected from all loaded documents
  • Nested Fields - Displayed with dot notation (e.g., address.city)

Column Management

Customize the table display with powerful column controls:

Showing/Hiding Columns

  • Right-click any column header to open the column menu
  • Check/uncheck columns to show/hide them from view
  • Hidden columns are remembered per collection
  • Use "Show All Columns" to reset visibility

Sorting Columns

  • Single Column Sort - Click header to sort ascending, click again for descending
  • Multi-Column Sort - Hold Shift and click headers to add secondary sort levels
  • Remove Sort - Click sorted column a third time to remove sort
  • Sort Indicators - ↑ ascending, ↓ descending, numbers show sort priority (1, 2, 3...)

Resizing Columns

  • Hover between column headers until resize cursor appears
  • Click and drag to adjust width manually
  • Double-click the border to auto-fit column to content width
  • Right-click and select "Auto-fit All Columns" to resize all at once

Reordering Columns

  • Click and drag any column header to move it
  • A visual indicator shows the drop position
  • Drop the column in the new position
  • Column order is saved and persists across sessions

Cell Data Display

Table View intelligently displays different data types in cells:

Data Type Display Format Notes
String Plain text Long strings are truncated with "..." and show tooltip on hover
Number Formatted number Right-aligned, thousands separators for large numbers
Boolean ✓ true / ✗ false Visual checkmark/X icons with color coding
Date Localized date/time Formatted based on user's locale, sortable as timestamp
ObjectId Short ID with copy icon Shows last 8 characters, click to copy full ID
Array [n items] Shows count, click to expand in modal viewer
Object {n fields} Shows field count, click to expand in modal viewer
Null null Italicized gray text
Undefined undefined Italicized gray text (missing field)

Bulk Operations

Select multiple documents to perform batch operations:

Selection Methods

  • Single Select - Click checkbox in selection column
  • Range Select - Click first row, hold Shift, click last row
  • Multi-Select - Hold Ctrl/Cmd and click individual rows
  • Select All - Click header checkbox or press Ctrl+A
  • Deselect All - Click header checkbox again or press Escape

Available Bulk Actions

  • Delete Selected - Remove all selected documents (with confirmation)
  • Export Selected - Export selected rows to JSON or CSV
  • Duplicate Selected - Create copies of selected documents
  • Update Field - Set a field value across all selected documents
  • Remove Field - Delete a field from all selected documents

Pro Tip

Use Table View's sorting and selection to quickly identify and modify groups of documents. For example, sort by a status field, select all rows with "pending" status, then use bulk update to change them to "processed".

Video COLLECTION_VIEW_TABLE_VIDEO_01 Table View Tutorial - Sort and filter columns, resize and reorder, select multiple rows, perform bulk operations, and export to CSV

BSON View

BSON View displays the raw JSON/BSON representation of your documents with syntax highlighting and formatting. This view is perfect for developers who prefer working directly with the document structure, copying JSON for code, or verifying the exact data format.

BSON View Features

Syntax Highlighting

Color-coded JSON with distinct colors for keys, values, types, and punctuation.

Pretty Printing

Automatically formatted with proper indentation and line breaks for readability.

Line Numbers

Easy navigation with line numbers in the gutter, clickable to select lines.

Code Folding

Collapse and expand objects and arrays to focus on specific sections.

Extended JSON

MongoDB extended JSON format for special types (ObjectId, Date, Binary, etc.).

Copy Functionality

Copy entire document, selected lines, or specific values with one click.

Search & Replace

Find text within JSON, with regex support and case-sensitive options.

Direct Editing

Edit JSON directly with validation, auto-complete, and error highlighting.

BSON Format Options

Toggle between different JSON formatting modes:

Extended JSON (MongoDB Format)

Default format that preserves MongoDB-specific types:

{
  "_id": { "$oid": "507f1f77bcf86cd799439011" },
  "createdAt": { "$date": "2026-04-02T10:30:00.000Z" },
  "tags": [ "mongodb", "database" ],
  "metadata": {
    "version": { "$numberInt": "2" },
    "active": true
  }
}

Strict JSON

Standard JSON format, converting MongoDB types to strings:

{
  "_id": "507f1f77bcf86cd799439011",
  "createdAt": "2026-04-02T10:30:00.000Z",
  "tags": [ "mongodb", "database" ],
  "metadata": {
    "version": 2,
    "active": true
  }
}

Shell Format

MongoDB shell format with constructors:

{
  _id: ObjectId("507f1f77bcf86cd799439011"),
  createdAt: ISODate("2026-04-02T10:30:00.000Z"),
  tags: [ "mongodb", "database" ],
  metadata: {
    version: NumberInt(2),
    active: true
  }
}

Code Editor Features

BSON View includes a full-featured code editor:

  • Auto-Indentation - Automatically indents nested structures as you type
  • Bracket Matching - Highlights matching braces, brackets, and parentheses
  • Auto-Closing - Automatically closes quotes, brackets, and braces
  • Multi-Cursor - Hold Alt/Option and click to place multiple cursors
  • Column Selection - Hold Alt+Shift and drag to select rectangular regions
  • Find & Replace - Ctrl+F to search, Ctrl+H for find-and-replace
  • Go to Line - Ctrl+G to jump to specific line number
  • Undo/Redo - Full undo history with Ctrl+Z and Ctrl+Y

Validation & Error Highlighting

When editing JSON directly, the editor validates syntax in real-time:

  • Syntax Errors - Red squiggly underlines for invalid JSON
  • Error Messages - Hover over errors to see detailed descriptions
  • Type Validation - Warns about invalid MongoDB extended JSON types
  • Required Fields - Highlights missing required fields like _id
  • Save Prevention - Cannot save document while errors exist

Copying JSON

Multiple options for copying document data:

  • Copy Document - Click copy icon to copy entire formatted JSON
  • Copy Selection - Select text and press Ctrl+C to copy highlighted portion
  • Copy as Shell Command - Right-click and copy as MongoDB shell insert command
  • Copy as Code - Copy with language-specific formatting (JavaScript, Python, etc.)
Video COLLECTION_VIEW_BSON_VIDEO_01 BSON View Tutorial - Switch between JSON formats, edit documents directly, use code folding, validate syntax, and copy JSON

Explain Query Performance

The Explain feature provides detailed insights into how MongoDB executes your queries, helping you identify performance bottlenecks, optimize indexes, and understand query execution plans. Use Explain to analyze any query running in the Collection View.

Quick Start

Run Explain on any collection query:

  1. Open a collection and apply filters or sorting
  2. Click the Explain button in the toolbar
  3. Select verbosity level: Query Planner, Execution Stats, or All Plans
  4. Review the execution plan and performance metrics
  5. Use the insights to optimize indexes or rewrite queries

Explain Verbosity Levels

Choose the appropriate level of detail for your analysis:

Level Information Provided Performance Impact Use Case
Query Planner Query plan, indexes used, stage breakdown Minimal Quick check of index usage without running query
Execution Stats All of Query Planner + execution timing, docs examined, docs returned Moderate (runs query) Detailed performance analysis of chosen plan
All Plans Execution All of Execution Stats + all candidate plans considered High (runs all candidate plans) Deep dive into query planner decision-making

Understanding Execution Stats

The Execution Stats view shows key performance metrics:

Overall Query Metrics

  • Total Execution Time - Total time to execute the query in milliseconds
  • Documents Examined - Number of documents MongoDB scanned
  • Documents Returned - Number of documents matching the query
  • Execution Success - Whether the query completed without errors
  • Number of Yields - Times the query yielded to other operations

Index Usage

  • Index Used - Name of the index MongoDB selected (or "COLLSCAN" for collection scan)
  • Index Keys Examined - Number of index entries scanned
  • Index Bounds - Min/max values scanned in the index
  • Multi-key Index - Whether the index covers array fields

Stage Breakdown

The execution plan is broken down into stages:

  • IXSCAN - Index scan (good - using an index)
  • FETCH - Fetching full documents after index scan
  • COLLSCAN - Collection scan (warning - no index used)
  • SORT - In-memory sort operation (warning - consider sort index)
  • PROJECTION - Field projection/selection
  • LIMIT - Limiting results (efficient)
  • SKIP - Skipping documents (can be inefficient for large values)

Performance Indicators

VisuaLeaf highlights potential performance issues with visual indicators:

Indicator Meaning Recommendation
🟢 Green Badge Efficient query with good index usage No action needed
🟡 Yellow Badge Moderate efficiency, room for improvement Review execution stats for optimization opportunities
🔴 Red Badge Inefficient query, performance concern Add indexes or rewrite query
⚠️ COLLSCAN Warning Full collection scan without index Create appropriate index for query fields
⚠️ SORT Warning In-memory sort operation Add index with sort field to avoid memory sort
⚠️ High Examined/Returned Ratio Scanning many more docs than returned Index may not be selective enough

Explain Visualization

The execution plan is displayed as an interactive tree:

  • Stage Nodes - Each stage shown as expandable node
  • Parent-Child Relationships - Shows how data flows through stages
  • Stage Metrics - Timing and document counts for each stage
  • Highlighted Bottlenecks - Slow stages highlighted in red/yellow
  • Interactive Exploration - Click stages to see detailed metrics

Optimization Recommendations

VisuaLeaf automatically analyzes explain output and provides actionable recommendations:

Common Recommendations

  • Create Index - Suggests specific index to create based on query pattern
  • Compound Index - Recommends combining multiple fields in one index
  • Covered Query - Suggests projection to make query fully covered by index
  • Index Direction - Recommends ascending/descending based on sort order
  • Query Rewrite - Suggests alternative query syntax for better performance

Example Recommendation Panel

Performance Warning

This query performed a COLLSCAN and examined 45,233 documents to return 12 documents.

Recommended Action:

Create a compound index on the queried fields:

db.users.createIndex({ status: 1, createdAt: -1 })

This index will allow MongoDB to:

  • Use index scan instead of collection scan
  • Avoid in-memory sort operation
  • Reduce documents examined from 45,233 to ~12

Expected Improvement: ~99.9% reduction in documents examined

Comparing Query Performance

Use Explain to compare different query approaches:

  1. Run Explain on your original query
  2. Save the execution stats
  3. Modify the query (add index, change filter, etc.)
  4. Run Explain again
  5. Compare side-by-side to see improvement
Video COLLECTION_VIEW_EXPLAIN_VIDEO_01 Explain Tutorial - Run explain at different verbosity levels, interpret execution stats, identify performance issues, review recommendations, and compare query performance

Best Practices

Choosing the Right View Mode

  • Use Tree View when exploring unfamiliar data structures or working with deeply nested documents
  • Use Table View when comparing values across multiple documents or performing bulk operations
  • Use BSON View when copying JSON for code, verifying exact formats, or making precise edits

Performance Tips

  • Limit the number of documents loaded (use filters and pagination)
  • Hide unnecessary columns in Table View to improve rendering performance
  • Collapse large arrays in Tree View when not needed
  • Use Explain regularly to catch inefficient queries early
  • Create indexes based on your most common query patterns

Workflow Efficiency

  • Memorize keyboard shortcuts for your most frequent actions
  • Save custom column layouts in Table View for different use cases
  • Use search (Ctrl+F) across all view modes to quickly locate data
  • Take advantage of context menus (right-click) for quick access to actions
  • Switch view modes frequently—each mode has strengths for different tasks

Pro Tip

Create a personalized workflow by combining view modes: use Table View to identify documents of interest, switch to Tree View for detailed exploration, then use BSON View to copy the exact JSON for your code. All three views work on the same result set, so switching is instant.

Ready to try VisuaLeaf?

Download and start managing your MongoDB databases with ease.

Download Free Trial