You cannot query your database as mentioned in your question using the actual database structure. In such cases, there is a practice named denormalization
and for that I recomend you see this video, Denormalization is normal with the Firebase Database.
In your case, you need to get the part
node out from chat node and create a new top level node in which you can store those values. I recomend you also use as the name of the child, the exact name that you want to query. In this case you will be able to attach a listener on that particular node and use exists()
method to check a child for existens.
In also recomend you read this post, Structuring your Firebase Data correctly for a Complex App for a better understanding.
There are two more resourses that I want to share, The Firebase Database For SQL Developers and NoSQL Data Modeling Techniques.