I'm using android studio 4.1.1
with Kotlin. I'm learning myself how to do android programming with Kotlin.
I'm trying to update records in my database.
In my code I'm doing this:
val ref = FirebaseDatabase.getInstance().getReference("weights").child(userId).child(weight.recordID.toString())
println("!!!!!!!!!!! Firebase reference: ${ref.toString()}")
ref.child("comments").setValue(weight.comments.toString())
ref.child("date").setValue(weight.date.toString())
ref.child("exerciseText").setValue(weight.exerciseText.toString())
...
My println shows: ...I/System.out: !!!!!!!!!!! Firebase reference: https://my-test-app-860ca-default-rtdb.firebaseio.com/weights/oB3pzvhAr6foyhGZUuvFl4CECOw2/-MQTjdSW6TkJkDTzOKlv
That looks correct - matches the record I'm testing: userID and recordID in Firebase web console.
The setValue()
code matches what I see in the Firebase docs: https://firebase.google.com/docs/database/android/read-and-write under setValue()
. I've verified via println's that the values I'm passing in are present
I'm not seeing the records update in my list in my app or in the Firebase web console.
Any ideas what I'm missing? Is there some other command I have to run to actually commit the changes?