Skip to content

Instantly share code, notes, and snippets.

@cbrannen9a
Created January 4, 2019 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cbrannen9a/4c3791c1fc766dbea8c80f6bd187255a to your computer and use it in GitHub Desktop.
Save cbrannen9a/4c3791c1fc766dbea8c80f6bd187255a to your computer and use it in GitHub Desktop.
Adding data to Firestore
import firebase_admin
import google.cloud
from firebase_admin import credentials, firestore
cred = credentials.Certificate("./ServiceAccountKey.json")
app = firebase_admin.initialize_app(cred)
store = firestore.client()
doc_ref = store.collection(u'test')
doc_ref.add({u'name': u'test', u'added': u'just now'})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment