Collection History
- MongoDB
Collection History lists the changes you made to a collection’s documents in the collection tab: inserts, edits and deletes, newest first. For each change it shows the document before and after, and Undo takes the change back.
Open the history
Section titled “Open the history”Choose Collection History… from a collection’s menu in the explorer, or run MongoDB: Collection History… from the command palette.
The list shows each change as Inserted, Edited or Deleted, with the document’s _id
and the time. Select a change to see the document Before and After it, and the command an
undo would run. Refresh reads the list again.
What is recorded
Section titled “What is recorded”These writes in the collection tab are recorded once the server has taken them:
- a document inserted with the document editor;
- an edit, of the whole document in the editor or of one value in place, removing a field included;
- the delete of one document.
These are not recorded: bulk updates and deletes, and other writes of many documents (a paste, the Data Generator, an import), writes from IntelliShell and the other tools, and the delete of a document read with a projection.
Undo a change
Section titled “Undo a change”Select the change and choose Undo. The confirmation shows the command; choose Undo again to run it.
| Change | The undo |
|---|---|
| Inserted | Deletes the document, only while it is as it was inserted. |
| Edited | Puts the document back as it was, only while it is as the edit left it. |
| Deleted | Inserts the document again. A document inserted since with the same _id makes it fail. |
An undo that finds the document changed since is refused and says why; undo the newer changes first. An undo is recorded as a change of its own, so it can be undone in turn, and the change it took back is marked undone. A read-only connection does not undo.
Where the history is kept
Section titled “Where the history is kept”The history is kept on this computer, in Querybara’s local store: the newest 500 changes of each collection, with the documents before and after. It holds only the changes made in this copy of Querybara, not changes made on other computers or by other people.
Clear history forgets the collection’s recorded changes after asking; the documents stay as they are. The history goes with the connection when you delete it.
Related
Section titled “Related”Documents Querybara 0.1.19 · built from89dc752