I have a firebase db like the one below:
and I'd like to select all events that come after a certain date. I've attempted to do this with the following code:
events := []data.EventData{}
if err := ref.Child("date").OrderByValue().StartAt(time.Now()).Get(c, events); err != nil {
fmt.Println("Error selecing upcoming events")
fmt.Println("Error:", err)
response.Message = "Problem getting upcoming events"
c.JSON(http.StatusInternalServerError, response)
return
}
But it keeps throwing the error:
Index not defined, add ".indexOn": ".value", for path "/Event/date", to the rules
What does this mean and how do I go about selecting the records that I need? Am I on the right track and just need to resolve this error or should I be taking a different approach?