TableCore

Schema explorer

MongoDB does not declare a schema, so the only way to know what is in a collection is to look. The schema explorer looks, and then tells you exactly how much it looked at.

Open it from a collection's context menu.

What it shows

For every field path:

  • the types it takes,
  • how often it is present at all,
  • a summary of its values — a range for numbers and dates, the most common values for low-cardinality strings, a length distribution for arrays.

Clicking a field inserts its path into the editor at the cursor. One Ctrl+Z undoes the insertion, and the dialog stays open, because reading a schema means picking more than one field.

The schema explorer listing each field path with the types it takes and how often it is present, above the sentence naming the sample it was read from.

It is a sample, and the page says which

An inferred schema is not a declared one

These numbers describe the documents that were read, not the collection. The sentence above the table always names the sample size, how it was drawn ($sample or the first N documents), and whether the whole collection was read. "97% of a 1,000-document sample" and "97% of the collection" are two different statements, and people act on them differently.

Two runs over the same collection can therefore give different numbers, and that is not a defect. If you need certainty about a field, the answer is a validation rule or a query, not a bigger sample.

"The whole collection" is proof, not arithmetic. It is set when the read asked for one document more than the sample size and got fewer — that is what exhausting a collection looks like. Comparing the sample against an estimated document count is not proof: that count comes from collection metadata and can be stale, so deriving "this is everything" from it would turn an estimate into a claim. When the total does come from metadata, the panel writes about.

Reading the percentages

The denominator of a nested field is its parent, not the sample. A field always present inside an optional subdocument is not a mostly-absent field.

For a path inside an array, the denominator is the documents that had the array, not the array elements. The panel says so — otherwise "2 of 3" reads as elements.

When the walk is cut short

Past a depth limit or a path-count limit the results are marked as truncated. An incomplete list that does not say it is incomplete is the same lie as an estimate presented as a fact.

Cancelling is not an empty schema. An interrupted read shows a message and a retry button, never "no fields" — that would be a claim about the collection that nothing supports.

What it is for

  • Before writing a query, to find out what the fields are actually called and which of them are reliably present.
  • Before proposing validation rules, which start from exactly this analysis.
  • Before a reshape, to see how many documents carry the field you are about to rename.
  • When a column in the grid shows mixed types and you want to know how mixed.

The charts are drawn as inline SVG by the application itself — there is no chart library and no external request involved in looking at your data.