You can't, sorry. you can only ask for key ranges based on prefix, you can get the values between [1, ...]
and [999, "foo"]
, but you can't possibly write a query that will give you the values between [..., "foo"]
and [..., "bar"]
For that, you need to write another view, one where the "demo"
fragment appears first in the resulting keys.