Created
February 22, 2022 19:46
-
-
Save Mgancita/7ada50d7d52a221de2bcce1dd9776a6e to your computer and use it in GitHub Desktop.
This file contains 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
from firebase_admin import firestore | |
db = firestore.client() | |
data = { | |
u'name': u'Los Angeles', | |
u'state': u'CA', | |
u'country': u'USA' | |
} | |
# Add a new doc in collection 'cities' with ID 'LA' | |
db.collection(u'cities').document(u'LA').set(data) | |
# Read data back in | |
db.collection(u'cities').document(u'LA').get() | |
# { | |
# u'name': u'Los Angeles', | |
# u'state': u'CA', | |
# u'country': u'USA' | |
# } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment