Document Store Explorer
The Document Store Explorer (/documents) browses the documents a monitored service stores, and shows how its document stores are configured — type-to-table mappings, store options, and the generated DDL.
Route: /documents. Documents are a peer subsystem to event sourcing, not a sub-feature of it: plenty of services use Marten, Polecat or Fisher document features with no event store at all. That is why this is its own top-level explorer rather than a tab inside the Event Store Explorer. The old /explorer?tab=documents deep link redirects here.
Three similarly-named surfaces
Documents live here. A monitored service's event streams live in the Event Store Explorer. The console's own frontend state lives in the Store Inspector.
Scope bar
The page uses the shared Service ▸ Store ▸ Tenant scope bar:
- Service — only services that actually report a document store are offered. Scope is shared with the global service selector in the header, and a
?service=deep link wins on arrival. - Store — modular monoliths host several document stores; the picker collapses to a static label when the service has only one, so a single-store service shows no redundant control.
- Tenant — appears only for multi-tenanted stores. A conjoined store offers All tenants as well as each tenant; a database-per-tenant store requires a pick, and the page says so ("Select a tenant to query this store.") rather than querying the wrong database. All tenants is an explicit request for every tenant's documents, and the results then carry a Tenant column. (On the store API, reading with no tenant means the default tenant, never every tenant.)
Scope and the active tab are written back to the URL, so any view you are looking at is a shareable link.
When nothing is reporting a document store the page reads "No services with document stores are currently reporting."
Overview tab
The Overview lists every service, every document store it registers and every document type each store maps, as a Tree (service, then store, then type) or a Table you can sort and filter. It is read from what each service reports about its stores, so it costs the databases nothing.
Counts are on demand. Choose Count on a type, or Count all on a store, for an exact row count. The page warns you before it counts, because a count reads each type's table and can be slow or costly on a large store. These are exact counts, not catalog estimates. Each one says when it was taken, and a long count can be cancelled. A tenanted EF Core context cannot be counted across its tenants, so it offers no count.
Sizes and row estimates are on demand too. Choose Sizes and estimates on a store (or Read in the table's Size column) and the service reads its database's own catalog for every document type's table: the table's size with its indexes, and the engine's estimate of its rows, shown as ≈ 12,345 and labelled an estimate. It is one cheap catalog read per store, never a scan of the tables, and like a count it shows when it was read and can be cancelled. An estimate is only as fresh as the engine's last statistics, so use Count when the number matters. What each engine gives:
| Engine | Row estimate | Size |
|---|---|---|
| PostgreSQL (Marten) | pg_class.reltuples, summed over a partitioned table's partitions. A table PostgreSQL has not analyzed yet has none, and says so. | pg_total_relation_size: the table, its indexes and TOAST |
| SQL Server (Polecat) | sys.dm_db_partition_stats row counts. Needs VIEW DATABASE STATE (VIEW DATABASE PERFORMANCE STATE on SQL Server 2022 and later); without it the read fails with SQL Server's own message. | Reserved pages over every index and partition |
| SQLite (Fisher) | sqlite_stat1, only after ANALYZE has run on the database; otherwise none, and the page says so. | Per table only where SQLite was built with dbstat. The SQLite bundled with Microsoft.Data.Sqlite, which Fisher uses, is not, so the page shows the whole database file's size instead. |
A sub-class reports its root type's table, since they share one. On a database-per-tenant store each database is read, at most 50 at once, under a 30-second budget, and the figures are summed across the databases that answered; a database that could not be read is listed with its error and left out of the sum, never counted as empty. A service on an older Wolverine.CritterWatch cannot answer, so the page says to upgrade it rather than wait. Reading sizes needs the same documents.read capability as counting, and is audited the same way. EF Core contexts offer no sizes.
A store that has not answered yet reads as asking…, and one that failed says so; neither is ever shown as having no documents. Click a type to open it on the Documents tab.
Documents tab
Pick a document type, then query it.
Filters. An id filter is always available. Beyond that, the offered filter facets are derived from what the store actually captures rather than from engine config — common metadata (version, last modified, tenant, soft delete) plus opt-in columns (correlation id, causation id, last modified by) that only appear when the store tracks them. You are never offered a filter the store cannot apply.
A store-level filter, applied per type
The opt-in columns are offered when any document type in the store captures them, but a store applies the filter only on a type that does. On a type that does not, it quietly returns the unfiltered page, and the rows carry no correlation, causation or user column to show it (jasperfx#1077). The page says so beside an applied metadata filter. Check which types enable the column in the store's configuration before reading the count as filtered.
Columns and page size. The grid shows one column per top-level member of the JSON, plus the store's own metadata, which the JSON does not carry: Last modified is on by default, and Version, Tenant and Type can be added from Columns. Columns can also be added by member path (ShipTo.City), matched case-insensitively. Choose 25, 50, 100 or 200 rows a page. The column layout is kept by the console for each document type, like saved filters: per user with RBAC on, one per console without it, so it follows you to another browser. Reset under Columns returns the type to the defaults.
Newest first. The Newest first switch orders the page by the store's last-modified column, most recent first (jasperfx#1058). An ORDER BY in the predicate bar then breaks its ties. A service whose Wolverine.CritterWatch client, or whose store package, predates the ordering says so instead of returning the page in its default order.
WHERE / ORDER BY. Filter and sort on the document's own properties. Type the body of a WHERE and, optionally, an ORDER BY; the page still owns the type, the paging and the total:
WHERE Status = "Open" and Total > 100 and ShipTo.City = "Austin"
ORDER BY PlacedAt descThe text is not turned into SQL by the console. It is sent to the monitored service, where the document store applies it through its own LINQ provider (jasperfx#869) — so you write the C# property names (case-insensitively), and the stored JSON's casing, enums stored as numbers or names, soft deletes, tenancy and hierarchies are the store's business, exactly as in application code. The dialect is C#-flavoured: = or ==, and / or / not, !=, = null, Name.StartsWith("Ac"), Tags.Contains("vip"), Items.Any(Quantity > 5), nested members such as ShipTo.City. An enum compares by name, and date text is read as UTC. The ? beside the box lists the shapes.
When the store cannot apply the text — it does not parse, names a property the type does not have, or uses a shape that store cannot translate — the refusal appears under the box with a caret at the column where it went wrong, and no page is shown. Some shapes are refused on purpose: anything that would run code on the service rather than in the query ("x".PadLeft(…), DateTime.UtcNow, static members, conditionals), and shapes a particular store would translate into the wrong rows. A service whose Wolverine.CritterWatch client predates the box ignores the text; the console says so rather than showing that service's unfiltered page as though it were filtered.
Saved filters and history. Every filter you apply to a type is remembered in Saved filters → Recent (the last 30 per type, the same filter applied again moving to the top). Save current filter names what is applied now; a star keeps a favourite at the top. Picking one fills every box and runs it. These are kept by the console, not the browser, so they follow you to another browser or machine. With RBAC on they are yours alone; with it off, everyone using this console shares one set. Reading them needs documents.read.
Watching a filter
A saved filter can raise an alert on a business condition, such as "tell me when Status = "Failed" is above zero". Choose the bell beside a saved filter. The console applies it and asks the store to explain it, then opens the Watch dialog: a comparison (above, below or changed), a threshold, a severity, and how often to count.
The console then counts the matching documents on the monitored service on that schedule, running the same store-side count the page runs, and raises an ordinary alert (DocumentFilterWatch, subject the watch's id) that Slack, webhooks, paging and AI triage treat like any other. The alert's View filter action opens this page on exactly what is counted. Watching in the Saved filters menu lists each watch with its last count and what it is saying now.
- Each watch is a recurring query on a production database, so the dialog shows the store's own plan for the filter and the index advice (the C# that would index what the filter reads) for one that reads the whole table, before you create it. A watch cannot run more often than every 5 minutes, and a store can have at most 20 watches.
- Unmeasurable is not zero. If the service does not answer, or its store now refuses the filter (a renamed property), the watch shows Cannot be measured and raises
DocumentFilterWatchUnmeasurable. It never resolves the condition and never counts as zero. Achangedwatch compares with the last count that was actually taken. - Permissions. Creating or deleting a watch needs
documents.watch, scoped to the store or the service, because it runs a query on a schedule and raises alerts others are paged for. The check is made once, when the watch is created; evaluating it does not depend on the creator's session, so a watch keeps running after the person who made it signs out. Deleting a watch resolves the alerts it had open. - A watch keeps its own copy of the filter, so editing or deleting the saved filter afterwards does not change what is being counted.
Fields. The Fields button opens a panel describing what is actually in the type's documents: one row per member path (nested members dotted, ShipTo.City), how often it is present, the JSON types it holds, its five commonest values and how many distinct values there are, and the range of a number or date member. Click a value and Member = value is written into the predicate box, joined with and to what is already there; Apply runs it. Shift-click a second value of the same member to add it as an alternative — (Status = "Open" or Status = "Closed") — rather than narrowing with and. A number or date member shows its range as three choices: ≥ min, min … max (both bounds) and ≤ max. It describes a sample: the first 200 documents of the type under the current filters, in the store's order, so a member that appears only on newer documents can read as rare, and the panel says how big the sample was. The member names are spelled as the store's serializer wrote them; the predicate box matches them regardless of case.
Health. The Health button answers two questions an ordinary database tool cannot, and it runs only when you press Check. It takes a bounded sample — the oldest and the newest documents of the type by last_modified, 200 in all — and says how big the sample was; every number in the panel is of that sample, never of the table.
- Deserialization. Each sampled document is run through the service's own serializer as a dry run (nothing is written). A document it refuses is listed with its id and the serializer's error; click the id to open the document. One bad document is one row, never a failed check.
- Shape over time. The older half of the sample is compared with the newer half, member by member: a member that appeared (absent from every older document), disappeared (absent from every newer one), or changed type (a JSON
nulldoes not count as a type). It needs a store that can order by last-modified; otherwise the panel says why there is no comparison, which is not the same as "no changes".
It needs the same documents.read capability as reading the documents, and the check is audited as a read.
Tenants. On a store with several tenants, the Tenants button counts the selected type per tenant under the current filter, so a tenant with far more documents than its siblings, or none, stands out. It runs only when you press Count, and it is one query per tenant (a database each on a database-per-tenant store). So at most 500 tenants are counted at once, under a 30-second budget. The panel shows the largest tenants first, with the smallest alongside, and says "counted N of M" whenever the answer is partial. A tenant that could not be counted shows its error and is never read as zero. Click a tenant to scope the page to it. A conjoined store whose tenants the console cannot list offers no counts.
Right-click to filter. Right-click a value in the grid, or a member in the document drawer, and choose Filter on (Member = value) or Exclude (Member != value). Like a click in Fields, it writes the clause into the box and Apply runs it. A member inside an array offers nothing, because the box reaches array elements through Items.Any(…), not by a member path.
Will it use an index? While you type, a line under the box estimates it from the indexes and duplicated columns the store reports for the type (the same list the Configuration tab shows): Likely served by ix_order_status on Status, or No reported index covers Total: this filter probably reads every row. It is an estimate made before the query runs, and it says so. It reads only which members the predicate names, so it cannot see selectivity, an or that needs two indexes, or a GIN index that serves containment but not =. When the store did not report the type's indexes, the line says the answer is unknown rather than guessing.
An index the filter could use. When that estimate calls a filter a scan, the page shows the C# that would index the member it filters on — opts.Schema.For<Order>().Index(x => x.Total);, the same spelling on Marten, Polecat and Fisher — with Copy. It is never applied from here: add it to the store configuration and deploy, and the store's schema migration builds it. A member inside a collection is named separately, because a plain index does not serve it.
Explain (jasperfx#1078). The estimate is made before the query runs; Explain is the measured answer. It runs the page again and asks the store how it executed the query, then says what the database did: how many rows it examined against how many it returned, which indexes it used, and whether it walked the whole table, with the engine's own plan text under Plan. It runs only on demand, because PostgreSQL's explain executes the query a second time to measure it. Where an engine's plan does not report a figure the page says it is unknown rather than showing zero. When the store cannot explain, refuses, or the service runs a Wolverine.CritterWatch client older than explain, the reason is shown instead. It needs the service's store on JasperFx 2.95 (Marten 9.54 / Polecat 5.46 / Fisher 1.24).
The predicate needs runtime code generation, so a service published with Native AOT refuses it; paging and the metadata filters still work there.
Soft-deleted documents are hidden. Turn on Include deleted to show them; each is tagged deleted and dimmed, and opening one says when it was deleted. Deletion lives in the store's metadata, not in the document's JSON, which is why the page marks it.
Hierarchies. Picking a type returns every row that is one, so a base type's page includes its sub-classes. When it does, a Type column names each row's concrete type. The type picker lists every mapped root and every sub-class, on all three stores (jasperfx#932), with each sub-class indented directly under its root, because its rows live in the root's table. A sub-class whose root is not in the list (an older client) is kept at the end rather than dropped.
Results. Documents render as a table with one column per top-level JSON key, unioned across the page. Scalar values render inline; object and array values render as a clickable chip that opens the nested JSON in a side drawer. A trailing action on each row opens the whole document's JSON in the same drawer. Results are paged, with the total count shown above the table.
Empty states are specific: "Select a document type to browse stored documents" before you pick one, and "No documents found" when a query genuinely comes back empty.
Open in SQL. Beside the type picker, Open in SQL opens the SQL tab on the same service, store and tenant, with select data from <table> where prefilled for the selected type. The table name is the one the store's own DDL creates for that mapping, never a naming rule the console guesses at — the prefixes differ per store (mt_doc_ for Marten, pc_doc_ for Polecat, and Fisher folds a non-default schema into the name). Until the store has reported its DDL the prefill stops at select data from ; pick the table yourself, and the answer lists every table you may query. A sub-class opens on its root's table, because that is where its rows are.
A link to one document, and export. An open document's Copy link copies a URL (?type=…&id=…, with the service, store and tenant) that opens that document directly. Export CSV / Export JSON save the current page as shown. CSV cells a spreadsheet would evaluate (starting =, +, -, @, a tab or a carriage return) are prefixed with ' so they open as text, since a document value is whatever somebody typed; plain numbers are left alone.
Compare with rebuilt (jasperfx#1082). For a type a single-stream projection produces, an open document offers Compare with rebuilt. The service aggregates the document's stream live through that projection, rendered by the store's own serializer so casing and enums match, and the drawer either says Stored matches a rebuild of its stream, or lists each member that differs with the stored and rebuilt values side by side. Nothing is written: a rebuild of the projection is what would write the right-hand values. When the stream rebuilds to nothing (no stream for that id, or the projection deletes the document), the drawer says what is stored is left over. The button is absent for any other type, including one whose projection is Live, which stores no document to compare. It needs the service's store on JasperFx 2.95 (Marten 9.54 / Polecat 5.46 / Fisher 1.24).
Copy as C#. An open document's Copy as C# copies class definitions for it, named after its type, with nested objects as classes and arrays as List<T>. They are inferred from that one document, not read from the service's code, and the copied text says so: a member this document lacks is missing, a null member reads as object?, a whole number as int. A member whose JSON name is not a valid identifier keeps it in [JsonPropertyName].
The scope carries between explorers. The store and tenant you pick here are what the Event Store Explorer opens on for the same service, and the other way round (the service already carried). Each applies a remembered store or tenant only when it offers it: a document-only store does not exist on the Event Store Explorer. A link that names a scope still wins. It lasts for the browser session and is not saved.
Editing and deleting a document
Open a document's full JSON (the eye icon at the end of its row) to Edit or Delete it.
- Through the store, never a raw
UPDATE. The monitored service deserializes your JSON with its store's own serializer and saves it through a session, so versioning, tenancy, soft deletes and Marten's duplicated columns come out exactly as an application save would leave them. What is stored can therefore differ from what you typed: after a save the drawer shows the document as stored and names any member the store dropped because the type does not carry it. - Review before saving. Review changes lists every member you changed, added or removed, and asks the store for a dry run of the save (jasperfx#1071): it names any member the store would DROP, or the reason it would refuse the save, before anything is written. A service whose client predates the dry run does not answer it, and the review says so; nothing is written either way.
- Version-checked. The save (and the delete) is checked against the version you loaded. If somebody changed the document since, nothing is written: the drawer shows the document as it is now and offers Overwrite with mine or Discard mine.
- Delete says which it will be before you confirm (jasperfx#1070). On a type mapped as soft-deleted the button reads Soft-delete: the row stays, marked deleted and hidden from reads, and a plain confirmation is enough. Otherwise it is a permanent delete and asks you to type the document id. A store package too old to report its delete style always reads as permanent, which errs on the side of the extra step.
- Restore. A soft-deleted document (shown with Include deleted) cannot be edited, but its drawer offers Restore: it becomes a live document again with a new version. It needs the same
documents.deletecapability as the delete it undoes. - Projection documents. When a projection produces the type, the drawer says so: an edit or delete there is overwritten by the next event on its stream, and by any rebuild.
Off outside Development, and license-gated
Editing needs a CritterWatch license (enforced on the monitored service) and is refused unless the service turns it on. It is on in Development only by default, even when document reads are on in production: reading business data and changing it are different grants.
builder.Host.UseWolverine(opts =>
{
opts.ServiceName = "my-service";
var critterWatch = opts.AddCritterWatchMonitoring(
critterWatchUri: new Uri("rabbitmq://queue/critterwatch"),
systemControlUri: new Uri("rabbitmq://queue/my-service-control"));
// Reading stored documents (follows EnableEventStoreExplorer when left unset).
critterWatch.EnableDocumentExplorer = true;
// Editing and deleting them. On in Development only by default, and it needs reads to be on too.
// Each edit is also license-gated on this service, RBAC-gated (documents.write / documents.delete)
// and audited on the console.
critterWatch.EnableDocumentEditing = true;
});With RBAC wired, the console also requires documents.write (edit) or documents.delete, and every edit and delete writes an audit entry. The JSON itself is never recorded in the audit log.
Permissions and agents
With permissions wired, reading documents needs documents.read (every read is audited), editing needs documents.write and deleting or restoring needs documents.delete. The same surface is available to AI agents: list_document_types, query_documents (with the same WHERE / ORDER BY text, the metadata filters and orderByMetadata: "LastModified desc") and get_document to read, and update_document (with dryRun: true for the review step's answer), delete_document and undelete_document to change. A document update and a permanent delete answer their first call with a preview and a confirmation token. See Document reads and Document writes.
SQL tab
The raw tier: one read-only SELECT in the database's own dialect, run on the monitored service against the selected document store. It is the same SQL view as the Event Store Explorer's — the same guard, table allow-list, read-only transaction, timeout, row cap, license gate, sql.query capability and Audit Log row — hosted here so a service with no event store can reach it too.
It is not the WHERE box on the Documents tab. That box takes C# property names and lets the store translate them; this one takes the engine's SQL over the stored JSON, which is also where the store-specific operators live:
-- Marten / PostgreSQL
select data from shop.mt_doc_order where data ->> 'Status' = 'Open'
select data from shop.mt_doc_order where data @? '$.Items[*] ? (@.Quantity > 5)'
-- Polecat / SQL Server
select data from dbo.pc_doc_order where JSON_VALUE(data, '$.Status') = 'Open'
-- Fisher / SQLite
select data from "fi_doc_order" where json_extract(data, '$.Status') = 'Open'The statement rides in the URL as ?tab=sql&sql=… next to the scope, so a prefilled or last-run statement is a shareable link. Nothing runs until you press Run. SQL is opt-in on the monitored service (CritterWatchOptions.EnableSqlQuery; on by default in Development only); a service that has not opted in answers with a configuration message rather than an error.
Configuration tab
The store's own shape, for when the question is "is this mapped the way I think it is?":
- Store identity and schema — which store this is and where its tables live.
- Options — the full document-store options description, with per-property tooltips sourced from the underlying library's XML docs.
- Document mappings — each document type and the table it maps to, with the generated DDL fetched on demand and rendered with syntax highlighting.
If the service cannot produce a store's DDL — the store is no longer registered on it, or building the snapshot failed — the tab says so and shows the service's reason, rather than reporting that no DDL was generated. The next time you open the tab it asks again.
