This libary is save me.
I use fbdo.playload() to print my document in firestore and here result:
15:15:20.919 -> {
15:15:20.919 -> "name": "projects/prjtest22222/databases/(default)/documents/users/oQz5x6rtlcP3i2Gyufjx8m8YjtC3/devices/ObjectName",
15:15:20.919 -> "fields": {
15:15:20.919 -> "relay-1": {
15:15:20.919 -> "stringValue": "false,true,false,0:0:0,0,client"
15:15:20.919 -> },
15:15:20.919 -> "relay-4": {
15:15:20.919 -> "stringValue": "false,true,false,0:0:0,0,client"
15:15:20.919 -> },
15:15:20.919 -> "relay-5": {
15:15:20.919 -> "stringValue": "false,true,false,0:0:0,0,client"
15:15:20.965 -> },
15:15:20.965 -> "relay-2": {
15:15:20.965 -> "stringValue": "false,true,false,0:0:0,0,client"
15:15:20.965 -> },
15:15:20.965 -> "relay-0": {
15:15:20.965 -> "stringValue": "false,true,false,0:0:0,0,client"
15:15:20.965 -> },
15:15:20.965 -> "relay-6": {
15:15:20.965 -> "stringValue": "false,true,false,0:0:0,0,client"
15:15:20.965 -> },
15:15:20.965 -> "relay-7": {
15:15:20.965 -> "stringValue": "false,true,false,0:0:0,0,client"
15:15:20.965 -> },
15:15:20.965 -> "relay-3": {
15:15:20.965 -> "stringValue": "false,true,false,0:0:0,0,client"
15:15:20.965 -> }
15:15:20.965 -> },
15:15:20.965 -> "createTime": "2021-04-15T05:35:14.027754Z",
15:15:20.965 -> "updateTime": "2021-04-15T07:51:34.013816Z"
15:15:21.012 -> }
FirebaseJsonData jsonData;
FirebaseJson js = fbdo.jsonObject();
for (int i = 0; i < relays_length; i++) {
js.get(jsonData, "relay-" + String(i));
if (jsonData.success) {
data[i] = jsonData.stringValue;
}
}
//or
Serial.println(fbdo.jsonString());
I need get key value. And when i try update the document with update mask, it print failed Invalid property path \"relay-0\".
Can you help me with the optimal solution.