Realtime database quering

Hi im trying to make quering possible in this database, i want to query by username and uid, but following this post

i cant make it work…

image

im using this url (https)
://app-default-rtdb.europe-west1.firebasedatabase.app/userinfo/info.json?orderBy=“username”&equalTo"elenaki_"=&print=pretty

Check the spelling of your directory path. In the directory tree you have it spelled “ifo”, and your rules are specifying “info”

1 Like

Another method you might want to use instead of “equalTo”, which requires the user to enter the exact name, you could use “startAt” and “endAt” to search for the closest match of what the user types in. For example if there is a username “John” and the user types in “Jo” then it will return all usernames that begin with “Jo”.

I use this formula url in my HTTP GET request (where pageVars.PAGE_PalName is the input variable the user enters):

"https://gud-boi-multimedia-default-rtdb.firebaseio.com/PrayPals/DATA/USERS.json" + "?orderBy=\"Name\"&startAt=" + "\"" + CAPITALIZE(LOWERCASE(pageVars.PAGE_PalName)) + "\"&endAt=" + "\"" + CAPITALIZE(LOWERCASE(pageVars.PAGE_PalName)) + "\\uf8ff" +"\""
1 Like

Woo Thank you so much for both! these are exactly what i need

1 Like

Another thing, I dont know if you do this, but when my users select their usernames I always wrap whatever they enter with CAPITALIZE(LOWERCASE(name)) so as to force their names into a consistently-defined letter case that I’m able specify in my Firebase query, regardless of what case the user types the search in…

1 Like

Yeah to tell you the truth im not but indeed its important, i will implement it, thanks a lot @JOHN_WORSHAM !