Skip to content

Instantly share code, notes, and snippets.

@andresmijares
Created March 11, 2019 02:06
Show Gist options
  • Save andresmijares/dedcbff0022b4df5469af073020e4272 to your computer and use it in GitHub Desktop.
Save andresmijares/dedcbff0022b4df5469af073020e4272 to your computer and use it in GitHub Desktop.
'use strict'
const admin = require('firebase-admin')
const serviceAccount = require('your_firebase_key')
admin.initializeApp({
credential: admin.credential.cert(serviceAccount)
})
const firestore = admin.firestore()
const settings = { timestampsInSnapshots: true }
module.exports.hello = async (event) => {
const data = firebase.collection('my_nice_collection')
.get()
.then(s => {
// do whatever you need with your data
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment