yuanhuadong

MongoDB学习笔记之 --- 批量更新数据

List<BsonValue> values = new List<BsonValue>();
foreach (var file in files)
{
var value= BsonValue.Create(file.NID);

values.Add(value);
}
var querys = Query.In("_id", values);
var update = Update.Set("Status", status);

 update.Set("UpdateTime", DateTime.Now);

var helper = new MongdbHelper<mTaskFile>();

helper.Table.Update(querys, update,MongoDB.Driver.UpdateFlags.Multi);

发表于 2013-12-10 21:15  华东童鞋  阅读(554)  评论(0编辑  收藏  举报
 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-12-21
  • 2021-12-21
  • 2022-12-23
  • 2021-12-01
  • 2021-12-21
  • 2021-12-21
猜你喜欢
  • 2021-12-21
  • 2021-12-21
  • 2021-12-21
  • 2022-12-23
  • 2021-12-21
  • 2021-12-14
  • 2021-09-01
相关资源
相似解决方案