Any 'read' function always returns '1' or 'true' #261
-
There is a massive possibility that I am doing something immensely stupid, but the fact that no one else seems to have ever encountered this problem seems like I have done something uniquely wrong. I am able to write to the database perfectly too, making me all the more confused. Any response would be greatly appreciated. code below for anyone insane enough to read my incomprehensible gibberish
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You should read the document and the examples showed how to use the library correctly. Returning the value from cloud related function is a bad choice and API design as it may fail in between due to many possibilities, the undesired and unknown value may return. We should take some reference object to store the operating result to the function to prevent setting undesired value to some variable and it can be reused such as session that keep in that object. Firebase-ESP8266/examples/Basic/Basic.ino Lines 128 to 183 in 3df9fd0 |
Beta Was this translation helpful? Give feedback.
You should read the document and the examples showed how to use the library correctly.
Returning the value from cloud related function is a bad choice and API design as it may fail in between due to many possibilities, the undesired and unknown value may return.
We should take some reference object to store the operating result to the function to prevent setting undesired value to some variable and it can be reused such as session that keep in that object.
Firebase-ESP8266/examples/Basic/Basic.ino
Lines 128 to 183 in 3df9fd0