日期:2014-05-18  浏览次数:20391 次

asp.net + MongoDB数据库 批量删除怎么做?求高手
asp.net + MongoDB数据库 批量删除怎么做?求高手 

C# code

            public void MonogDBUpdate(Guid empId)
        {
            QueryDocument query = new QueryDocument();
            query.Add("EmployeeId", empId);
            query.Add("State", AuditState.Uncommitted);
            UpdateDocument update = new UpdateDocument();
            update.Add("State", AuditState.Pending);
            update.Add("SubmitTime", DateTime.Now.ToLocalTime());
            DatabaseHelper.Update(Tables.EmployeeLogs, query, update, UpdateFlags.Multi);
            
        }

  public static SafeModeResult Update(string collection, IMongoQuery query, IMongoUpdate update,UpdateFlags fla)
        {
            
            if (query == null)
                throw new ArgumentNullException("参数 query 不能为null");
            if (update == null)
                throw new ArgumentNullException("参数 update 不能为null");
            var db = DatabaseHelper.GetDataBase();
            MongoCollection c = db.GetCollection(collection);
            return c.Update(query, update, fla,SafeMode.False);
        }



我这样写修改不了 也不报错

------解决方案--------------------
探讨
asp.net + MongoDB数据库 批量删除怎么做?求高手


C# code


public void MonogDBUpdate(Guid empId)
{
QueryDocument query = new QueryDocument();
query.Add("Employe……

------解决方案--------------------
建议到.net版去问问.
------解决方案--------------------
非SQL SERVER内容,请转版.