Skip to content

Instantly share code, notes, and snippets.

@brunobraga95
brunobraga95 / exportFirestoreDB.js
Created January 29, 2018 01:13
exportFirestoreDB
const admin = require('firebase-admin');
var serviceAccount = require("./your-firestore-key.json");
admin.initializeApp({
credential: admin.credential.cert(serviceAccount)
});
const dumped = {};
const schema = {
@brunobraga95
brunobraga95 / copyFirestoreDB.js
Last active August 12, 2021 14:35
Copy firestore database
const firebase = require('firebase-admin');
var serviceAccountSource = require("./source.json"); // source DB key
var serviceAccountDestination = require("./destination.json"); // destiny DB key
const sourceAdmin = firebase.initializeApp({
credential: firebase.credential.cert(serviceAccountSource)
});
const destinyAdmin = firebase.initializeApp({