I am trying to retrieve an object that fills this class:
type Room struct {
Name string
People []Person
Chat []ChatMessage
Me Person
}
The data field "People" comes up as an empty slice []. I am using a simple find to get the data.
result := Room{}
err = c.Find(bson.M{"name": "dev"}).One(&result)
What am I doing wrong?
Figured it out....
The answer can be found here: https://groups.google.com/d/msg/mgo-users/KirqfCSlKFc/t2l3l4yxFRwJ
Basically, just need to add 'bson: ""' at the end of the People []Person line
Figured it out....
The answer can be found here: https://groups.google.com/d/msg/mgo-users/KirqfCSlKFc/t2l3l4yxFRwJ
Basically, just need to add 'bson: ""' at the end of the People []Person line
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With