angular / angularfire

Angular + Firebase = ❤️
https://firebaseopensource.com/projects/angular/angularfire2
MIT License
7.64k stars 2.2k forks source link

Filter Data not work for child value.(like OrderByChild..) #2539

Closed halilpolathalil closed 3 years ago

halilpolathalil commented 4 years ago

Version info

Angular:8.1.2

Firebase:5.5.7

AngularFire:5.4.2

Other (e.g. Ionic/Cordova, Node, browser, operating system):opera

How to reproduce these conditions

Sample data and security rules "MYDATA": 1

"MY FİREBASE RULES":

"MESSAGES": { "toPersonList":{ ".indexOn": ["personId"] }

Expected behavior

I want filter data on the Message Tabel. For filtering I used foolowing codes. How can I filter my data by personId in "MESSAGES/toPersonList/{id}/personid".

Actual behavior

this.db.list(this.firebaseTableName, ref => ref.child('toPersonList').orderByChild("personId").equalTo("WOmi7o5X8Zni7WQJGaU5")).valueChanges();

For testing; I add "personId" to all levels of ""MESSAGE. But I always get empty data.

jamesdaniels commented 3 years ago

I'm not sure what exactly you're trying to achieve here, but if you're trying to filter the messages list that's not the right approach. StackOverflow would be a better forum for questions of this nature.