Because Firestore enforces no schema, only the code shows which fields are written. Document purpose, fields, writers, retention and deletion path for every collection.
Why Firestore is a challenge
Firestore stores documents without a fixed schema. Which fields actually occur depends on what the code writes. On top of that, several places often write to the same collection: the app, cloud functions and admin scripts.
What to record per collection
- Name of the collection and its purpose
- Fields that may relate to a person
- Who writes: app, cloud function, admin script
- Who reads and who is allowed to read
- Retention period and its reasoning
- Deletion path, including subcollections
Deleting: do not forget subcollections
When a Firestore document is deleted, its subcollections remain. Anyone who wants to remove a person’s data must therefore also consider these subcollections. Record the complete deletion path in your documentation.
Finding write sites in code
Look for the write calls of your SDKs: set, add and update in the Admin and Client SDKs, including batches and transactions. Check cloud functions and admin scripts as well as the app, because they often write to the same collections. A scanner can collect these sites and list the written fields with their source position.
What the code does not tell you
Dynamically built paths and field names cannot always be resolved; they belong in the documentation as open points. Only your team knows purpose, legal basis and providers.
General information, not legal advice. Assess your individual case separately.