Closed wave2way closed 11 months ago
Add Likes function on JSONQueryExpression
` type UserWithJSON struct { gorm.Model Name string Attributes datatypes.JSON }
DB.Create(&User{ Name: "json-1", Attributes: datatypes.JSON([]byte({"name": "jinzhu", "age": 18, "tags": ["tag1", "tag2"], "orgs": {"orga": "orga"}})), }
{"name": "jinzhu", "age": 18, "tags": ["tag1", "tag2"], "orgs": {"orga": "orga"}}
var result UserWithJSON DB.First(&result, datatypes.JSONQuery("attributes").Likes("%jin%", "name")) `
why the test container start failed with "Error: One or more containers failed to start." ?
What did this pull request do?
Add Likes function on JSONQueryExpression
User Case Description
` type UserWithJSON struct { gorm.Model Name string Attributes datatypes.JSON }
DB.Create(&User{ Name: "json-1", Attributes: datatypes.JSON([]byte(
{"name": "jinzhu", "age": 18, "tags": ["tag1", "tag2"], "orgs": {"orga": "orga"}}
)), }var result UserWithJSON DB.First(&result, datatypes.JSONQuery("attributes").Likes("%jin%", "name")) `