Skip to content

Document Stats ​

LazyFire displays document statistics to help you monitor Firestore limits compliance.

Firestore Limits ​

Firestore has specific limits for documents:

MetricLimit
Document size1 MiB (1,048,576 bytes)
Field count20,000 fields
Nesting depth20 levels
Field name size1,500 bytes
Field value size~1 MiB
Document path6 KiB (6,144 bytes)
Index entries40,000

Stats Display ​

When viewing a document, stats are shown at the top of the Details panel:

Size: 45.2 KB / 1MB  Fields: 156 / 20000  Depth: 4 / 20
Field Name: 24 / 1500 B  Field Value: 2.1 KB / 1MB  Path: 48 / 6144 B

Color-Coded Warnings ​

Stats are color-coded based on percentage of limit:

ColorUsageMeaning
Green< 50%Safe
Cyan50-70%Moderate
Yellow70-85%Warning
Orange85-100%Critical
Red> 100%Over limit

What Each Stat Means ​

Size ​

Total document size in JSON format. Large embedded data (images, long strings) increases this.

Fields ​

Total number of fields, including nested fields. Each key in a map counts as a field.

Depth ​

Maximum nesting level. {a: {b: {c: 1}}} has depth 3.

Field Name ​

Longest field name in bytes. Relevant for deeply nested structures with long keys.

Field Value ​

Largest single field value size. Watch for large strings or embedded JSON.

Path ​

Document path length. collection/doc/subcol/subdoc - relevant for deeply nested documents.

Index Entries ​

Estimated number of index entries for the document. Firestore creates index entries for each field, and composite indexes multiply this. LazyFire calls the Firestore Admin API to detect composite indexes and provide an accurate count. When composite indexes cannot be determined (emulator mode or API errors), the count is shown with a ~ prefix to indicate it is approximate.

Use Cases ​

  • Pre-migration checks - Verify documents won't exceed limits
  • Debugging - Find why writes are failing
  • Optimization - Identify documents that need restructuring
  • Monitoring - Track document growth over time

See Also ​

Released under the MIT License.