Mongodb – How to insert an ObjectId into a document in mongo and golang
I'm having a problem inserting an ObjectId into a doc. this is the collection sale model type Sale struct { ID primitive.ObjectID `bson:"_id,omitempty"` Client primitive.ObjectID `bson:"client"` Items []primitive.ObjectID `bson:"items"` Amounts []int `bson:"amounts"` Cost float64 `bson:"cost"` Payment bool `bson:"payment"` Date time.Time…