Here my struct
type studentData struct {
Name string `bson:"name"`
Grade int `bson:"Grade"`
}
type student struct {
student []studentData `json:"student"`
}
I need my JSON result like this
{
"array": [
{
"Name": "ethan",
"Grade": 2
},
{
"Name": "rangga",
"Grade": 2
}
]
}
I get the data from mongoDB, already tried to search but did not found that i need, could someone help me?