m29h

joined 1 year ago
[–] [email protected] 1 points 1 year ago* (last edited 1 year ago) (1 children)

Why don't you just set the id to whatever ( e.g UUID) you want in your struct constructor. Alternatively I guess there are also mongodb specific client libraries for Go

The documentation of package mongo says for example ``` If the document does not have an _id field when transformed into BSON, one will be added automatically to the marshalled document.