How can I get all data in a particular node that starts with a given String
.
For example, let's say I want to return all tags that start with the String
"bas" (it should return [basketball: 1, baseball: 4].
tags: {
basketball: 1,
baseball: 4,
football: 0
}
I thought something like this (following the answer in this SO question for reference), but unfortunately it doesn't return anything...
ref.child("tags")
.queryStarting(atValue: text)
.queryEnding(atValue: "\(text)zzzzzzz")
.getData { error, snap in
// ...
}