https://github.com/poode/firebase-modeling
Get firebase/firestore entity model to migrate to mongo or any db later
https://github.com/poode/firebase-modeling
data database firebase firestore modeling schema
Last synced: about 2 months ago
JSON representation
Get firebase/firestore entity model to migrate to mongo or any db later
- Host: GitHub
- URL: https://github.com/poode/firebase-modeling
- Owner: poode
- Created: 2022-07-03T21:51:34.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-07-10T22:04:45.000Z (almost 4 years ago)
- Last Synced: 2025-08-09T06:27:11.434Z (11 months ago)
- Topics: data, database, firebase, firestore, modeling, schema
- Language: JavaScript
- Homepage:
- Size: 147 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Firebase/Firestore Schema Finder
Since I asked this question [Database modeling to migrate to mongodb](https://stackoverflow.com/questions/72815824/database-modeling-to-migrate-to-mongodb).
I got no answers so I started the hard way to find my project schema for each entity.
Project is still under development and of course bug can be showen at any time :)
Also It was a sketchy code I did not take care of code quality so you are welcome to enahnce with me.

### Result is like that:
```
{
"testCollection/{document}/anotherSubCollection": {
"anyField": "String"
},
"testCollection": {
"stringFiled": "String",
"nullField": "Null",
"geoPointField": "GeoPoint",
"arrayFiled": "Array",
"boolenField": "Boolean",
"numberFiled": "Integer",
"refField": "Reference",
"timestampFiled": "Timestamp",
"mapFiled": "Map",
"testField": "String",
"anotherTestField": "String"
},
"testCollection/{document}/testSubCollection": {
"testSubcollectionField": "String"
},
"testCollection/{document}/anotherSubCollection/{document}/subOfSubCollection": {
"anyField": "String"
}
}
```
## Note
You will get generated files in your home directory as below:
* `pathSchema.txt` where I collect the full paths to process later.
* `dbPaths.json` where I get the collectiona and subcollections full paths.
* `schema.json` where We can get the final result.
## Known Issue:
The script takes too much time, this is becuase of db data, as the script loop on each document to find sub-collections