Copy and paste
Copy values, fields, paths and whole documents in several formats, paste documents into a collection, and copy collections between servers.
Right-click a cell in Table View or a node in Tree View and open Copy. What you copy goes to the system clipboard, ready for a text editor, a spreadsheet, a script or another collection.
Copy values and fields
- Select one or more cells (click, Ctrl-click, Shift-click).
- Press the shortcut, or right-click > Copy and pick an entry:
| Entry | Shortcut | You get (example on a customer) |
|---|---|---|
| Copy Value As Text | Ctrl+C | The value as displayed: Dana Brook |
| Copy Value | Alt+Shift+C | The typed value in shell syntax: NumberInt(3) |
| Copy Field | Ctrl+Alt+C | Name and value: "name" : "Dana Brook" |
| Copy Field Path | Ctrl+Shift+Alt+C | The full dotted path: address.city |
| Copy Date (ObjectId values only) | The creation date held in the ObjectId |
With several cells selected, each row of the table becomes a line and cells are separated by tabs.
Copy whole documents
Right-click one or more selected documents > Copy:
| Entry | Shortcut | Format |
|---|---|---|
| Copy Document / Copy Selected Documents | Shift+Ctrl+C | Shell syntax, lossless for every type. One document, or an array of them |
| Copy … as CSV | A header line, then one row per document | |
| Copy … as CSV (no headers) | Rows only | |
| Copy … for Excel | Tab-separated rows that spreadsheet applications paste as cells, with a header line; hidden columns are left out | |
| Copy … for Excel (no headers) | Rows only |
The entries read “Copy Document …” with one document and “Copy Selected Documents …” with several.
Paste documents into a collection
- Copy documents (from this application, a file or anywhere else) as shell syntax or Extended JSON: one document or an array.
- Open the target collection and press Ctrl+V in the result, or right-click > Paste Document(s)….
- Read the confirmation: it says how many documents will be pasted, into which collection, on which server.
- Confirm. The page reloads with the new documents.
Each document keeps its original _id. If a document with the same _id already exists, the pasted
one gets a new ObjectId instead: pasting never overwrites an existing document.
Copy collections and databases
In the connection tree:
- Select a collection or a database and press Ctrl+C (Copy Collection / Copy Database), or right-click > Copy Collection / Copy Database. To copy every collection of a database instead, right-click it > Copy All Collections/Views/Buckets (no shortcut).
- Select the target database or connection, possibly on another server, and press Ctrl+V or right-click > Paste Collections.
- In the dialog, choose what to do when the target already exists. Pasting onto an existing collection
appends by default and skips documents whose
_idalready exists; existing documents are overwritten only if you choose to overwrite them.
Copy Name (Ctrl+Alt+C) copies just the names of the selected nodes, one per line.
Tips
- Copy Value is the right choice when you want to paste a value into a query: it keeps the type.
- Copy Value As Text on a whole document in the JSON: Pure format warns you that types are lost.
- For a large number of documents, use Export instead of the clipboard.
Troubleshooting
| Message | What to do |
|---|---|
| The clipboard holds no documents to paste | The clipboard text is not a document or an array of documents. Copy it again as JSON. |
| Paste is greyed out or refused | The collection is locked with the padlock, the connection is read-only, or the tab shows a view. |