-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to use thrift query mongo '_id' field? #64
Comments
I believe mgo uses the 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 👍 |
I use a helper to convert query map data to thrift obj. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The text was updated successfully, but these errors were encountered: