Replies: 1 comment 6 replies
-
The Let's see the code below. object_t json, json1, json2;
JsonWriter writer;
writer.create(json1, "data1/value", random(1000, 2000));
writer.create(json2, "data2/value", random(1000, 2000));
writer.join(json, 2, json1, json2);
Serial.println("Updating data (JSON object only)...");
Database.update(aClient, "/test/json", json, asyncCB, "updateTask1");
writer.create(json1, "data2/value", "hello");
Database.update(aClient, "/test/json", json1, asyncCB, "updateTask2");
writer.create(json2, "data3/value", "goodbye");
Database.update(aClient, "/test/json", json2, asyncCB, "updateTask3"); The first task will update value to the The second task update the value to the same path i.e. The third task will update the value to the same path Finally, data in {
"data1":{
"value":1140
},
"data2":{
"value":"hello"
},
"data3":{
"value":"goodbye"
}
} The second and third updates will not replace your whole data but only its children's nodes. Then you have to verify the input data before you call |
Beta Was this translation helpful? Give feedback.
-
Hi mobizt and community!
At the moment I am integrating this library in my project with a communication to RTDB and Firestore at the same time.
I dont have to write extremely much data, but still it would be good to send data always in a json to save unnecessary traffic..
So, for Firestore that is already supported - thank you for those PatchOptions!
But for the RTDB I am missing that feature.
I started to try the Database.update with the JSON of only changed values.
But sadly all the other entries get deleted when the data is send to the RTDB.
Is there already a solution to this or do I really need to send each database entry as a single "Database.set"?
hint: I already studied your examples, but the only solution I found until now is to write the single data separately.
Thank you for any support!
Beta Was this translation helpful? Give feedback.
All reactions