The problem of using mongodb in golang gin

Hello, everyone. I use the ginweb framework as a service and use mgo to connect to mongo,. There is a timestamp in my database that I wrote when I created statuct user: CreatedTime float64 bson:created_time here I tried time.Time,int, float64, but the data didn"t exist. All the other fields are available, and my timestamp is like xxxxxxxxxxx.xx, so I"d like to ask what the data structure here should be, thank you.

golang newcomers, please give us more advice

already know the answer is due to the format error created_time needs to be quoted

Nov.14,2021
Menu