FirebaseExtended / firebase-arduino

Arduino samples for Firebase.
Apache License 2.0
945 stars 494 forks source link

Setting a Custom Key When Pushing New Data to Firebase Database through using the firebase-arduino Library #483

Closed magiusdarrigo closed 4 years ago

magiusdarrigo commented 4 years ago

Here I am adding new JSON data into my firebase database. However, the data generates a new unique key for the data. I would like to remove that unique key or make it custom. Whichever is easier.

const size_t capacity = JSON_ARRAY_SIZE(2) + JSON_OBJECT_SIZE(1) + 30; DynamicJsonBuffer jsonBuffer(capacity); const char* json = "{\"todayTimestamp\":[42,18]}"; JsonObject& root = jsonBuffer.parseObject(json); Firebase.push("Dates/",root); "todayTimestamp2" is an example of how I need the JSON data to be added. picture here: https://stackoverflow.com/questions/60898180/setting-a-custom-key-when-pushing-new-data-to-firebase-database-through-using-th