Closed ZiRunHua closed 3 months ago
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question
template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking ✨
Oh, I found the reason.
change datatypes.JSONSet("trans_info").Set("trade_time", nextTime)
to datatypes.JSONSet("trans_info").Set("TradeTime", nextTime)
. I forgot I was working on a json string.
I know there are many disadvantages to using json, but in some cases it can improve development efficiency.
I happened to use JSON_SET in a scenario but found that it did not work properly and I tried several methods without success. Considering that JSON_SET can modify json fields without querying the database, it would be very bad if JSON_SET could not be used in future work, so I submitted this issue.
Env
Executable sample code
It's also a simplified version of my business code