I have a list of chats with an array field named users_in_chat in Firebase. Is there any way I can query only the chats which contain current user id?
I tried this
database.getReference("Chats")
.orderByChild(current_user.getUser_doc_id()).equalTo(Boolean.TRUE)
.addListenerForSingleValueEvent(new ValueEventListener() {//Using user id as an indexing field}
but I got this error
PersistentConnection: pc_0 - Using an unspecified index. Your data will be downloaded and filtered on the client
is there an efficient way to query using a user id?