zl程序教程

您现在的位置是:首页 >  其他

当前栏目

C# Mongdb 之MongDb.Driver的 UpdateReault 参数解析

2023-04-18 14:55:24 时间

UpdateReault参数解析


        //
        // 摘要:
        //     Gets a value indicating whether the result is acknowledged.
        public abstract bool IsAcknowledged { get; } //标识Update操作是否被确认 及update有没有成功
        //
        // 摘要:
        //     Gets a value indicating whether the modified count is available.
        //
        // 言论:
        //     The available modified count.
        public abstract bool IsModifiedCountAvailable { get; }//标识update操作是否进行了计数  如果IsAcknowledged&&IsModifiedCountAvailable--更新成功且可获取更新条数;如果 IsAcknowledged&&!IsModifiedCountAvailable--更新成功 但是无法获取更新条数 【该结果仅有驱动程序返回 只读】
        //
        // 摘要:
        //     Gets the matched count. If IsAcknowledged is false, this will throw an exception.
        public abstract long MatchedCount { get; }
        //
        // 摘要:
        //     Gets the modified count. If IsAcknowledged is false, this will throw an exception.
        public abstract long ModifiedCount { get; }
        //
        // 摘要:
        //     Gets the upserted id, if one exists. If IsAcknowledged is false, this will throw
        //     an exception.
        public abstract BsonValue UpsertedId { get; }//更新对象不存在 就会新增一条 该属性返回新增数据的_id