Edit: I want to filter all the post liked by someone using their phone number
My app was working since 3 years earlier i got warning in console about indexOn issue and i have added security rules as per instructed, now when i have updated firebase sdk and also now I'm using addOnCompleteListener instead of valueEventListener now some part of my app not working and now I'm getting exception about indexOn
I don't how to add index for this kind of key as it keeps changing as per user. if I hardcode users phone number then it is working but I can't add keys for every user as there are few thousand user so please let me know what i can do. here are few attachments about database, query and rules
query
FirebaseDatabase.getInstance()
.getReference("2 line poetry").orderByChild(number).equalTo("heart");
Rules(currently used which works on previous version)
Rules(Hardcoded version which is working in new version)
I want to make this rule dynamic like using variable $phone or something, I have read almost all threads but didn't found any answer