Skip to content

Explorer

  • MongoDB

The explorer is the tree under a MongoDB connection in the side bar. It lists databases and, inside each, the collections, views, time series collections, GridFS buckets, users and roles. You open objects from it, list a database’s collections with their statistics in the Objects tab, start the tools, create databases, collections and views, rename, duplicate and clear collections, and drop objects.

Each database holds these folders:

Folder Contents
Collections Collections with their document count. Each has an Indexes folder with its indexes and their keys.
Views Views.
Time series Time series collections.
GridFS buckets Buckets with their file count.
Users The database’s users.
Roles The database’s roles.

system.* collections are left out of Collections, and so are a bucket’s .files and .chunks collections, which appear as the bucket instead. The tree reads no documents: counts and sizes come from listDatabases and $collStats, for the first 200 collections of a folder.

Double-click the connection to connect; its tree then unfolds. In the tree:

  • A click on a collection, view or time series collection opens it in a collection tab, or brings it forward if it is open. A collection’s chevron expands it instead, to show its Indexes folder.
  • A click on a database, or on one of its folders, opens or folds it and lists what it holds in the Objects tab. Its chevron only opens or folds it.
  • Double-click a bucket, user, role or index, or select it and press Enter:
Node Opens
GridFS bucket The GridFS browser
User or role The users and roles editor
Index The index manager

Press Ctrl + P (Cmd + P on macOS), Go to Table or Collection…, to jump to a collection by a few letters of its name. It searches what the explorer has loaded, and the collections of the first eight databases of each connected MongoDB connection (admin, config and local left out). See Command palette.

A click on a database lists its collections in the Objects tab, one row per collection with its Documents, Size, Storage size, Index size and Indexes. A click on a folder, such as Views or GridFS buckets, lists that folder’s objects.

  • Select a column header to sort by it. The search box narrows the list by name.
  • A click selects a row; Ctrl or Cmd adds to the selection, and Shift extends it.
  • Double-click a row, or press Enter, to open it as the tree does: a collection’s documents, a bucket’s files.
  • Right-click a row for the same menu as in the tree.
  • The toolbar has Open, New collection and Refresh. The status bar shows the count and the selection.

See Objects view for the tab across engines.

Hover a node and open its Actions menu, or right-click the node. The items follow this order, with separators between the groups:

Node Menu items
Database Open IntelliShell, Open SQL; Copy Name, Paste Collection, Add Collection…, Add View…, Export Collections…, Import Collection…, Transfer Data To…, Back up…, Restore…; Manage Users, Manage Roles; DB Statistics, Query Profiler, Current Operations, Server Status, Server Build Info; Watch Changes, Watch the Whole Deployment; Compare structure with…, Compare data with…; Refresh; Drop Database…
Collection, view or time series Open Collection Tab, Open IntelliShell, Open SQL, Open Aggregation Editor; Copy Name, Copy Collection, Paste Documents…, Rename Collection…, Duplicate Collection…, Clear Collection…; Manage Indexes, Edit Validator and Options… (View Options on a view), Add View Here…; Analyze Schema…, Watch Changes, Reschema…, Data Masking…, Generate Data…, Collection History…, Export Collection…, Import into Collection…, Transfer Data To…; Collection Statistics, Maintenance…; Refresh; Drop Collection… or Drop View…
Collections folder Open IntelliShell, Add Collection…, Paste Collection, Export Collections…, Import Collection…
Time series folder Add Time Series Collection…
Views folder Add View…
GridFS bucket Open GridFS View
Users or Roles folder Manage Users or Manage Roles
Indexes folder or an index Manage Indexes; an index also has Drop Index…
User or role Open in Users and Roles, Drop User… or Drop Role…
  • Paste Collection appears, with the collection’s name, after a Copy Collection. See Copy and paste.
  • A view has no Copy Collection, Paste Documents…, Rename Collection…, Duplicate Collection…, Clear Collection…, Manage Indexes, Watch Changes, Reschema…, Data Masking…, Generate Data…, Collection History…, Import into Collection… or Maintenance… item. Duplicate Collection… is for plain collections only.
  • On a read-only profile the items that paste, add, rename, duplicate, clear, import, restore and drop are not shown.
  • Menu items that have keys show them, such as Ctrl + L beside Open IntelliShell. See MongoDB toolbar and keys.
  • On a selected node, Ctrl + O (Cmd + O on macOS) opens a collection, view or time series collection, and Ctrl + N on a database, its Collections folder or a collection opens Add Collection…. The menus show them beside Open Collection Tab and Add Collection…. See Keyboard shortcuts.

MongoDB creates a database with its first collection, so a new database starts with one.

  1. Choose New database… in the connection’s menu, or run Database: New Database… from the command palette and pick the connection.
  2. In the New database dialog, enter the Database name and the name of the First collection.
  3. Fill in the rest as for a new collection (see below), check the command shown under the form, and choose Create….

The dialog refuses a database name MongoDB would refuse, such as one with a space, a . or a $, or one of 64 bytes or more. A read-only connection does not offer New database….

  1. Open the menu of a database or its Collections folder and choose Add Collection…. You can also choose New collection in the Objects tab, or run Create Collection… from the command palette and pick the database.
  2. Enter a Name and pick a Kind: Plain, Capped, Time series or Clustered.
  3. Fill in the fields of that kind (see the table below), and optionally a Collation and a Validator with its Validation level and Validation action.
  4. Check the command shown under the form, choose Create…, then confirm with Create.
Kind Fields
Plain None.
Capped Size (bytes) and Most documents (optional).
Time series Time field, Meta field (optional), Granularity and Delete documents after (seconds, optional). Time series collections take no validator.
Clustered Delete documents after (seconds, optional). Clustered collections need MongoDB 5.3 or later.
  1. Choose Add View… on a database or the Views folder, or Add View Here… on a collection.
  2. Enter the View name and the Source collection or view.
  3. Build the Pipeline from stage cards, as in the aggregation editor.
  4. Check the createView command shown under the form, choose Create…, then confirm with Create.
  • Rename Collection… asks for the New name. Tabs already open on the collection keep its old name.
  • Duplicate Collection… asks for the Name of the copy (orders_copy for orders, to start with). It copies the documents into the new collection with $out, then creates each of the collection’s indexes on the copy.
  • Clear Collection… deletes every document with deleteMany({}). The collection and its indexes stay.

Each one shows the exact command before it runs; choose Rename, Duplicate or Clear to run it. Copy Name puts the collection’s or database’s name on the clipboard.

  • Collection Statistics, DB Statistics and Server Build Info open IntelliShell and run db.orders.stats() (for a collection named orders), db.stats() or db.serverBuildInfo().
  • Query Profiler, Current Operations and Server Status open the server tools on Top queries, Sessions and the Monitor.
  • Maintenance… opens Maintenance on the collection.

Choose Drop Database…, Drop Collection…, Drop View…, Drop Index…, Drop User… or Drop Role… from the node’s menu. The confirmation shows the exact command it runs; choose Drop to run it.

Documents Querybara 0.1.19 · built from89dc752