I am trying to retrieve the sub collection IDs from Fire store to store it locally on my ESP32 and the functions mentioned in the library to retrieve the collection IDs return an empty string.
The path of the sub collection that I am trying to retrieve is this
String floorPlanPath = "apartment_profiles/" + uid_ + "/floor_plan";
I can confirm that the path to retrieve the collection id is correct. The code I have used for it is:
String subcollectionPayload = documents_.list(
asyncClient_,
Firestore::Parent(projectId_),
subcollectionPath,
ListDocumentsOptions());
This returns an empty string because I am assuming because this is a sub collection and not a list of documents so I instead used:
String subcollectionPayload = documents_.listCollectionIds(
asyncClient_,
Firestore::Parent(projectId_),
subcollectionPath,
ListCollectionIdsOptions());
To see if there are any issues with user authentication or any connection issues, I used this following path which is a document:
/apartment_profiles/zIDbf2KGl9ee38ggDgfpXEgAjk53/floor_plan/98:3D:AE:E6:88:C5/area/abde
And the function returned the document information without an issue when I used the
String subcollectionPayload = documents_.list(
asyncClient_,
Firestore::Parent(projectId_),
subcollectionPath,
ListDocumentsOptions());
In the Documents.h of the FirebaseClient library, there are a list of functions that can be used and I am not sure what function I have to use for my case to return the collection ids. I can confirm it is a sub collection because there is a button called ‘add document’ and not ‘add collection’. I am using this to load the Fire store data to the ESP32 device.
Thanks!