In my case I needed to make sure equalTo()
gets an argument of proper type. Here, it was not String but Long (instead of Long this method expects arg to be a Double, so convert it first).
val id: Long
val query = ref.orderByChild("id").equalTo(id.toDouble())
In other case whole root node was deleted.
As of deleting, as mentioned in other's answers using removeValue()
.