Trying to add time stamps to an array in cloud firestore #449
Unanswered
CalColistra
asked this question in
Q&A
Replies: 1 comment
-
Due to array value has limitations
Then it's not possible to add the server timestamp to the new appended array or existing array at specific index The option The only possible way is to create your device (client) timestamp string and add to the data to append. Instead of using array, using the map value with server timestamp that can be append to some field as in this example is recommend. |
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, have been trying to add time stamps of the current time to an array. I'm using firebases REQUEST_TIME to get the current server value as shown in the examples. I can't seem to get it working. I used one of the examples and I got it to transform a single data field, updating the time stamp with the current time but I want to figure out how to have it add a new time stamp to an array field instead.
I believe my error is on the line where I set the transformation type because in the example it uses:
field_transforms.transform_type = fb_esp_firestore_transform_type_set_to_server_value
instead of:field_transforms.transform_type = fb_esp_firestore_transform_type_append_missing_elements;
Currently, when I call this function, it shows that my payload is empty and does not add or change anything in my database.
Is it possible to have my esp32 to add new timestamps to an array field? I apologize if I'm missing something obvious here.
I very much appreciate any help with this.
Here is the code I have so far:
Beta Was this translation helpful? Give feedback.
All reactions