You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
In my case , ı'm using mongodb driver. In this model "SecondId" decoded correctly but "ID" doesn't decode it would be 000000000000 because "ID" bson starts with lower case letter or underline. When i make bson:"_id" to bson:"Id" it works correctly but i can't do this because mongodriver doesn't work that way correctly. Id parameter should be "_id".
type MyModel struct {
ID primitive.ObjectID `bson:"_id" json:"id" `
SecondId primitive.ObjectID `bson:"SecondId,omitempty" json:"secondId"`
CreatedAt int64 `bson:"CreatedAt,omitempty" json:"createdAt"`
Text string `bson:"Text,omitempty" json:"text"`
}
In my case , ı'm using mongodb driver. In this model "SecondId" decoded correctly but "ID" doesn't decode it would be 000000000000 because "ID" bson starts with lower case letter or underline. When i make
bson:"_id" to
bson:"Id" it works correctly but i can't do this because mongodriver doesn't work that way correctly. Id parameter should be "_id".output:
The text was updated successfully, but these errors were encountered: