我有这样的模型
模型.go
type yourTableName struct {
Name string `gorm:"type:varchar(50)" json:"name"`
Email string `gorm:"type:varchar(50)" json:"email"`
FieldNameOfJsonb JSONB `gorm:"type:jsonb" json:"fieldnameofjsonb"`
}
array of object我想使用 GORM 在 postgres 中插入 FieldNameOfJsonb
如下所示
{
"name": " james",
"email": "james@gmail.com",
"FieldNameOfJsonb": [
{
"someField1": "value",
"someFiedl2": "somevalue",
},
{
"Field1": "value1",
"Fiedl2": "value2",
}
],
梦里花落0921
婷婷同学_
慕慕森
相关分类