Open webbking opened 1 year ago
Can map[string]interface{} be used as a parameter during updates
是否可以将map 类型的数据执行更新操作。结构体对于未赋值的字段,像int类型 默认为0 ,导致原数据被覆盖。
@webbking 建议只使用查询功能, 更新操作建议使用 gorm。如果你有方法可以发个 PR
是否可以将map 类型的数据执行更新操作。结构体对于未赋值的字段,像int类型 默认为0 ,导致原数据被覆盖。
这样不合理, 如果确实要更新为 0, 将无法处理.
When updating the database, dynamically implement: ignore the field if it does not exist