Skip to content

Instantly share code, notes, and snippets.

View edwinvrgs's full-sized avatar
🏠
Working from home

Edwin Vargas edwinvrgs

🏠
Working from home
View GitHub Profile
@edwinvrgs
edwinvrgs / FirebaseToFirestore.js
Created February 16, 2019 04:33 — forked from JoeRoddy/FirebaseToFirestore.js
Convert Firebase Database JSON to Firestore Collections
var db = firebase.firestore();
var content = require("./sourceData.json");
content &&
Object.keys(content).forEach(contentKey => {
const nestedContent = content[contentKey];
if (typeof nestedContent === "object") {
Object.keys(nestedContent).forEach(docTitle => {
firebase
.firestore()