草庐IT

KirqfCSlKFc

全部标签

go - 使用golang的mgo库,如何获取列表等嵌套对象

我正在尝试检索一个填充此类的对象:typeRoomstruct{NamestringPeople[]PersonChat[]ChatMessageMePerson}数据字段“People”作为一个空slice[]出现。我正在使用简单的查找来获取数据。result:=Room{}err=c.Find(bson.M{"name":"dev"}).One(&result)我做错了什么?想通了....答案可以在这里找到:https://groups.google.com/d/msg/mgo-users/KirqfCSlKFc/t2l3l4yxFRwJ基本上,只需要在People[]Person

go - 使用golang的mgo库,如何获取列表等嵌套对象

我正在尝试检索一个填充此类的对象:typeRoomstruct{NamestringPeople[]PersonChat[]ChatMessageMePerson}数据字段“People”作为一个空slice[]出现。我正在使用简单的查找来获取数据。result:=Room{}err=c.Find(bson.M{"name":"dev"}).One(&result)我做错了什么?想通了....答案可以在这里找到:https://groups.google.com/d/msg/mgo-users/KirqfCSlKFc/t2l3l4yxFRwJ基本上,只需要在People[]Person