How to unflatten flat json into nested firestore documents
- Step 1Identify the flat key format — Check whether the flat keys use dot notation (user.name) or underscore separation (user_name). Choose the matching separator in the options so the unflattener knows where to split keys for nesting reconstruction.
- Step 2Paste the flat JSON object or array — Paste the flat JSON. The unflattener processes each key by splitting on the separator and rebuilding the nested map structure level by level.
- Step 3Review the reconstructed structure — Check the output JSON to confirm the nesting matches the expected Firestore document shape. Look for any keys that were split incorrectly due to underscores or dots that are part of the value name rather than a separator.
- Step 4Import to Firestore — Use the Firebase Admin SDK to write the document: admin.firestore().doc('collection/docId').set(unflattenedObject). For bulk imports, iterate the array and batch write using admin.firestore().batch().
Frequently asked questions
How does the tool handle keys with underscores that are part of a field name, not a separator?+
This is a common ambiguity with underscore-separated flat keys. If your data has fields like created_at that should NOT be split, use dot notation in the source flat JSON instead — created_at stays as a top-level field but user.profile.created_at nests correctly under profile. Alternatively, prefix fields with a namespace that makes the separator unambiguous.
Can I unflatten an entire Firestore collection export?+
Yes. If the flat JSON is an array of flat objects, the unflattener processes each element in the array and produces an array of nested Firestore documents. Pass the array to the Firebase Admin SDK's batch write loop for a full collection restore.
Is the Firestore user data transmitted to JAD Apps?+
No. The JSON unflattening runs entirely in your browser. User profiles, subscription data, and any PII in the flat records are never transmitted to JAD Apps servers.
Privacy first
Conversion runs locally in your browser. No file is uploaded — only metadata counters are saved for signed-in dashboard stats.