I have a nested collection/document Firestore DB:
/events/evtid/users/user
Coll Docs Coll Docs
I am trying to get the document ids from evtid
documents using the below script:
import firebase_admin
from firebase_admin import credentials
from firebase_admin import firestore
# Use a service account.
cred = credentials.Certificate('mycredentials.json')
app = firebase_admin.initialize_app(cred)
db = firestore.client()
coll = db.collection("events").stream()
for doc in coll:
print(f'{doc.id}')
But nothing is presented. If I put an id for an especific document in evtid
and the subcollection users
->
coll = db.collection("events").document("someid").collection("users").stream()
then it gets the documents (user). I don't know the ids for the documents in evtid
and I first need to find them out.
What am I doing wrong?