MongocampDocumentHistory
Who changed one document of an audited declared collection (server 2.3, audit), when, and what: a drawer (USlideover) with the newest records first.
<MongocampDocumentHistory v-model:open="open" collection="orders" :document-id="id" />| Prop | Default | Description |
|---|---|---|
collection | — | Required. The collection. |
documentId | — | Required. The document's id (hex of an ObjectId, or the plain id). |
pageSize | 20 | Records per request; Load older asks for the next page. |
canRestore | false | Server 2.11: an opened record offers Restore this version (the state after it) and Restore the state before — confirmed, then restoreVersion; the list reloads and restored (document id) is emitted. A refusal (a rule, validation) stays in the dialog. On a drafts collection the confirmation and the toast say the restored state waits in the working copy. |
A restore record names the record it came from (from the record of …, server 2.11 restoredFrom); clicking it opens that record. MongocampCollectionData sets canRestore for writers and reloads on restored. | v-model:open | false | Open state. Nothing is asked before it opens; closing it or another document aborts a running request. |
Each record shows the operation (Inserted, Updated, Replaced, Deleted, Moved to deleted, Restored), the user, the time and the changed fields; Changes opens a compare of the document before and after the write (only differences, switchable). A collection without audit — or a deleted document the user may not see — shows a note instead of an error (the server's 404).
MongocampCollectionData opens it from the History row action of an audited collection (also on read-only and deleted rows). The list itself is MongocampHistoryEntries (rows, showDocument, emits selectDocument(id)), shared with MongocampCollectionHistory. Data: useMongocampHistory.
Root classes mongocamp-document-history (drawer content) and mongocamp-history-entries (the list, part table).