If I get you right you have one record in "clOfferMaster" collection and you're trying to fetch data from nested collection "Eligibility". That's probably not a typical way to work with data.
What if you restructure your data as follows:
[
{
"ComponentId" : "SessionDayCheck",
"ConfigData" : [
"WED"
]
},
{
"ComponentId" : "TransDayCheck",
"ConfigData" : [
"WED",
"THU"
]
},
{
"ComponentId" : "SessionTransCheck",
"ConfigData" : ""
}
]
It that case you can do the following query
c := session.DB("offerengine2").C("clOfferMaster")
var result struct {
ConfigData []string "ConfigData"
}
err = c.Find(bson.M{"ComponentId": "SessionDayCheck"}).One(&result)
if err != nil {
log.Fatal(err)
}
fmt.Println("Result:", result)
// Result: {[WED]}