Skip to content

Document editor and bulk changes

  • MongoDB

The document editor opens a document as mongosh text, so every BSON type stays exact: ObjectId(), ISODate(), NumberDecimal(), NumberLong(), UUID(), BinData() and the rest. A save only replaces the document if nobody changed it since you opened it. A single value can also be edited where it is shown, in Table View or Tree View. Bulk update and bulk delete work on every document that matches the collection tab’s query, and count them before anything changes.

  1. In the collection tab, hover a document and choose Edit, or right-click it and choose Edit Document….
  2. Change the text in the Edit document dialog. Syntax errors are marked with their line and column as you type.
  3. Choose Save.
{
_id: ObjectId('66f1c0a2e4b0a1b2c3d4e5f6'),
name: 'Oak dining chair',
price: NumberDecimal('189.00'),
addedAt: ISODate('2026-03-14T09:30:00Z')
}

Ctrl + Enter (Cmd + Enter on macOS) in the editor also saves.

When someone changed the document meanwhile

Section titled “When someone changed the document meanwhile”

The save is a replace that only happens while the stored document still equals the one you opened. If someone changed it in the meantime, nothing is saved. The dialog says “Someone changed this document after you opened it; it was not saved” and shows their current version. Then:

  • Reload their version drops your edit and loads the current document.
  • Overwrite with mine… asks “Overwrite the newer version?” and, if you choose Overwrite, replaces their version with yours.
  • Cancel closes the editor.

If the collection has a validator and the document breaks it, the error lists each failed rule with its field, and the editor stays open.

In Table View or Tree View, double-click a value to edit it where it is shown, in its type: 42 typed into an Int32 field stays an Int32, a date is ISO text, and an ObjectId is its hex. The list beside the value changes the type: String, Int32, Int64, Double, Decimal128, Boolean, Date, ObjectId, UUID, Null, or mongosh expression, which takes any value in mongosh syntax. A value of another type, such as binary data, starts as a mongosh expression.

  • Press Enter to save, or Esc to cancel. Text that does not fit the type says why, and nothing is saved.
  • Right-click a value for Edit Value, Remove Field…, Copy Value and Copy Field Path (such as items.0.qty).
  • In Table View, drill into a sub-document or an array to edit its fields and elements. In Tree View, a sub-document or an array is edited as part of the whole document.
  • The _id cannot change, so it is not edited in place.

The save replaces the stored document only while it is unchanged since it was read. If someone changed it, nothing is saved: the tab says so and shows the current version. Saving a value asks first on a production or confirm-writes connection, and Remove Field… always asks, with the replaceOne command it runs.

  • Insert in the result toolbar, or Ctrl + D (Cmd + D on macOS), opens an empty Insert document dialog.
  • Clone opens a copy without its _id; the server gives the new document its own.
  • Delete always asks “Delete this document?” and shows the deleteOne command first.

The same actions are in a document’s right-click menu: Edit Document…, Clone Document…, Insert Document… and Remove Document…. Inserts, edits and single deletes made here are recorded in the collection history, where you can undo them.

  1. Set the Query in the collection tab to the documents you want to change.
  2. Choose Bulk update…, or press Ctrl + U (Cmd + U on macOS). The dialog shows the filter.
  3. Enter the update: operators such as { $set: { status: 'shipped' } }, or a pipeline.
  4. Choose Count matches. This is a dry run: it reports how many documents match, for example “75 documents match (dry run: nothing changed yet)”.
  5. Choose Update 75 documents…. The confirmation shows the exact updateMany command; choose Update to run it.

When it finishes, the dialog reports how many documents were updated out of those matched. Changing the update text after counting clears the count, so you count again before running.

Choose Bulk delete…, or press F8. The dialog counts the documents matching the current filter straight away, then offers Delete n documents…. The confirmation shows the exact deleteMany command; choose Delete to run it.

Connection What happens
Read-only Documents can be viewed and copied, not changed.
Production, or confirm writes Every write shows its command and asks before it runs.
Any Deletes, bulk updates and drops always ask first.

Documents Querybara 0.1.19 · built from89dc752