I have a firebase dataset with URLs as keys, such as in this example:
{
"urls" : {
"http%3A%2F%2Flincoln%2Emetacannon%2Enet%2F2005%2F10%2Ffashion-of-gods%2Easpx" : true,
"http%3A%2F%2Flincoln%2Emetacannon%2Enet%2F2005%2F10%2Fgod-is-dead-again%%2Easpx" : true,
"http%3A%2F%2Flincoln%2Emetacannon%2Enet%2F2005%2F10%2Fzugos%2Easpx" : true,
"http%3A%2F%2Flincoln%ZZmetacannon%ZZnet%2F2005%2F11%2Fgods-creature%ZZaspx" : true
}
}
Using the REST API, when I try to specify a startAt string that includes some kind of special character like %, it stops working. For example, the following query works fine:
https://fb-query-tester.firebaseio.com/urls.json?orderBy="$key"&startAt="http"
And returns the whole dataset:
{
"http%3A%2F%2Flincoln%2Emetacannon%2Enet%2F2005%2F10%2Ffashion-of-gods%2Easpx": true,
"http%3A%2F%2Flincoln%2Emetacannon%2Enet%2F2005%2F10%2Fgod-is-dead-again%%2Easpx": true,
"http%3A%2F%2Flincoln%2Emetacannon%2Enet%2F2005%2F10%2Fzugos%2Easpx": true,
"http%3A%2F%2Flincoln%ZZmetacannon%ZZnet%2F2005%2F11%2Fgods-creature%ZZaspx": true
}
But when I try:
https://fb-query-tester.firebaseio.com/urls.json?orderBy="$key"&startAt="http%3A"
It returns an empty set:
{}
I thought maybe I needed to urlencode the query parameter, so I tried:
https://fb-query-tester.firebaseio.com/urls.json?orderBy="$key"&startAt="http%253A"
But it still returned nothing. I'm not sure what to do at this point. Please help!
It looks like you can use double-percents to encode a percent. But you have to URL-encode them, so instead of using
%%
in place of each%
, you would use%25%25
.So for your example, you could start at the second entry using this URL:
https://fb-query-tester.firebaseio.com/urls.json?orderBy="$key"&startAt="http%25%253A%25%252F%25%252Flincoln%25%252Emetacannon%25%252Enet%25%252F2005%25%252F10%25%252Fgod-is-dead-again%25%25%25%252Easpx"