skip to Main Content

Mongodb – How to insert string as ISODate to mongo db, using golang?

I have the following transaction struct type Transaction struct { ID primitive.ObjectID `json:"id" bson:"_id"` Category primitive.ObjectID `bson:"category,omitempty"` Amount string `json:"amount" binding:"required"` Owner primitive.ObjectID `bson:"owner,omitempty"` Date primitive.DateTime `bson:"date" json:"date"` //Date time.Time `bson:"date" json:"date"` } var transaction models.Transaction if err := c.ShouldBindJSON(&transaction);…

VIEW QUESTION
Back To Top
Search