I have these structs
type Notification struct {
Content []NotificationContent `json:"content"`
CreatedAt time.Time `json:"createdAt"`
}
type NotificationContent struct {
Language string `json:"language"`
Title string `json:"title"`
}
And I'm trying to query my Firestore database to fetch any notification that have a specific Language
.
Using
query := client.Collection("notifications").Where("Content.Language", "==", "en")
or
query := client.Collection("notifications").Where("Content.Language", "in", [1]string{"en"})
always return null.
Using nodejs I could also use
client.Collection("notifications").where("Content", "array-contains", { Language: "en" })
but I have no idea how to translate to GO
Thanks for any input!
EDIT Data structure and sample data as requested