Open zhymin77 opened 11 years ago
I believe mgo uses the bson
tag as such:
type Test struct {
ID string `bson:"_id"`
}
yes, :)
How to define struct like this use thrift4go?
Thrift doesn't support this in the spec file and therefore there's no way to auto-generate with tags this way. You can create your own structs and then write conversion functions between the auto-generated struct and your own struct.
tks :+1:
I use a helper to convert query map data to thrift obj.
how to struct a field, when i extract mongo '_id' field's value? I use mgo driver. I can define a Struct like that: type Test struct { ID string "_id" } extract '_id' value to ID field successfully .
tks.