Created
November 2, 2021 13:10
-
-
Save Jviejo/5da7fafcb4653d3d5eb8188b306b3682 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Import only what you need | |
const admin = require('firebase-admin'); | |
process.env['FIRESTORE_EMULATOR_HOST'] = 'localhost:8081'; | |
var serviceAccount = require('./curso_inicio.json') | |
admin.initializeApp({ | |
credential: admin.credential.cert(serviceAccount), | |
projectId: "curso-de-inicio", | |
}); | |
var database = admin.firestore(); | |
(async () => { | |
const docRef = database.collection('campo').doc('alovelace122/campo/12'); | |
await docRef.set({ | |
first: 'Ada modif11', | |
last: 'Lovelace122', | |
born: 18152 | |
}); | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment