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.
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.