Hello, I am trying to do the following
``` go
package main
import (
"fmt"
"github.com/gofrs/uuid"
"gitlab.tryvium.io/booking-platform/booking-platform-backend/mongoutil"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
"golang.org/x/net/context"
)
type A struct
{ ID uuid.UUID `bson:"id"` Name string `bson:"name,required"` }type Alias struct
{ A `bson:",inline"` ID mongoutil.UUID `bson:"id,required"` }func main()
{ c, _ := mongo.Connect(context.Background(), options.Client().ApplyURI("mongodb://admin:admin@localhost:27017")) coll := c.Database("tryvium").Collection("test") id, _ := uuid.NewV4() aa := A\{ID: id, Name: "test"} bb := Alias{A: aa, ID: mongoutil.UUID(aa.ID)}
_, err := coll.InsertOne(context.Background(), bb)
fmt.Println(err)
}
```
However I get the following error on run
`cannot transform type main.Alias to a BSON Document: struct main.Alias) duplicated key id`
Is there any way to restructure my 2 structs to achieve what I want, which is having ID field changed in `Alias` struct?