Update Mongodb

This commit is contained in:
sunkaixuan
2025-05-09 20:19:47 +08:00
parent 1bd6343372
commit 61548b2bbd
2 changed files with 8 additions and 2 deletions

View File

@@ -44,6 +44,12 @@ namespace MongoDbTest
.Where(it=> it.Id == ids.Last())
.ExecuteCommand();
var updateRow4 = db.Updateable<OrderInfo>()
.SetColumns(it => it.CreateTime == DateTime.Now)
.SetColumns(it => it.Name == "xx")
.Where(it => it.Id == ids.Last())
.ExecuteCommand();
var delrow = db.Deleteable(new OrderInfo() { Id = ids.Last() })
.ExecuteCommand();