Replies: 2 comments 5 replies
-
The payload is string of JSON. It need to pass to JSON parser e.g. FirebaseJson to get the value you want. The JSON structure of payload returned from Fitestore can be complex which based on your database structure. To parse payload with FirebaseJson class. if (Firebase.Firestore.getDocument(&fbdo, FIREBASE_PROJECT_ID, "", documentPath.c_str(), mask.c_str()))
{
Serial.println("PASSED");
Serial.println("------------------------------------");
FirebaseJson json;
json.setJsonData(fbdo.payload());
FirebaseJsonData data;
json.get(data, "fields/Singapore/mapValue/fields/time_zone/integerValue");
if (data.success)
Serial.println(data.stringValue);
json.get(data, "fields/Singapore/mapValue/fields/population/integerValue");
if (data.success)
Serial.println(data.stringValue);
Serial.println("------------------------------------");
Serial.println();
} |
Beta Was this translation helpful? Give feedback.
5 replies
-
I could get the information with Arduinojson library. but your way is better. Thanks!!!
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello!
im folowing the get_Document Example on Firestore, but i can't get the key & values for the fbdo.payload() to move to other var's.
I really apreciated of you could give an example how handle the information im geeting.
Example.
String documentPath = "info/countries";
String mask = "Singapore";
Regards.
Beta Was this translation helpful? Give feedback.
All reactions