I'm trying to query on multiple keys in my Firebase database
-users
-De0pYw8liHRCZBBtoDibLoINbNA3
-displayName: Bobby Davidson
-email: bobDavidson@gmail.com
-username: bobbyD1981
Given a single input (i.e., "bobby"), how can I setup my firebase query to match on both the displayName
and username
of the above user simultaneously?
I currently have the following which matches only on the username
var ref = firebase.database().ref('users');
ref.orderByChild('username').startAt(input).endAt(input + "\uf8ff").once("value")
Thanks for any help!