globalsign / mgo

The MongoDB driver for Go
Other
1.97k stars 230 forks source link

Nested structure Problem #218

Closed h1048576 closed 6 years ago

h1048576 commented 6 years ago

err := c.Find(query).All(&d)

when d is a struct, and he has a field is struct array, unmarsh d is null

for example: type DS struct { A int bson:"a" B int bson:"c" C []CS bson:"c" }

type CS struct { X int bson:"x" Y int bson:"y" }

C is []