首页 新闻 会员 周边

mongodb samus驱动的 updateall方法怎么用

0
悬赏园豆:40 [已解决问题] 解决于 2015-01-04 09:41
 mongodb samus驱动的 updateall方法怎么用
 void UpdateAll(object document, object selector);
col.UpdateAll(对象名,true)我是这样用的求解,居然成功全部更新了,我改成false还是成功,我改成null异常了,请问他的参数都是什么意思 啊 ,如果我要无条件更新全部该怎么写
树形图的主页 树形图 | 初学一级 | 园豆:4
提问于:2013-07-18 14:42
< >
分享
最佳答案
0
public void Update(object document, object selector, UpdateFlags flags){
            var writerSettings = _configuration.SerializationFactory.GetBsonWriterSettings(typeof(T));

            try {
                _connection.SendMessage(new UpdateMessage(writerSettings)
                {
                    FullCollectionName = FullName,
                    Selector = selector,
                    Document = document,
                    Flags = (int)flags
                }, DatabaseName);
            } catch (IOException exception) {
                throw new MongoConnectionException("Could not update document, communication failure", _connection, exception);
            }
        }

这是源码。

收获园豆:40
海上将军 | 菜鸟二级 |园豆:306 | 2014-10-19 19:21
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册