using SqlSugar; namespace MongoDbTest { public class QueryJson3 { public static void Init() { var db = DbHelper.GetNewDb(); db.DbMaintenance.TruncateTable(); db.Insertable(new NoticeEntity() { Id = 12312312L, NoticeTitle = "88888", noticeContentInfos = new List() { new NoticeContentInfo { SubjectId = 1 } } }).ExecuteCommand(); var da = db.Updateable() .SetColumns(it => new NoticeEntity { NoticeTitle = "66666" }, true).Where(it => it.Id == 12312312L) .ExecuteCommand() > 0; } } } /// /// 通知公告 /// [SugarTable("NoticeInfoComponent")] public class NoticeEntity { [SugarColumn(ColumnName = "_id")] public long Id { get; set; } /// /// 通知公告标题 /// public string NoticeTitle { get; set; } = null!; /// /// 通知公告内容 /// [SugarColumn(IsJson = true)] public List noticeContentInfos { get; set; } = null!; } public class NoticeContentInfo { /// /// 模块 /// public int SubjectId { get; set; } }