I tried 2 ways.
First:
getUserReference()?.get()?.addOnSuccessListener {}
Second:
getUserReference()?.addListenerForSingleValueEvent(object : ValueEventListener {
override fun onDataChange(snapshot: DataSnapshot) {}
override fun onCancelled(error: DatabaseError) {}
})
But as I understand it, it returns all the data. Regardless of whether there was a data update or not. I want to upload data only if there have been changes on the server. How can this be done? Or I don't understand something.