コード例 #1
0
        private Task <WriteConcernResult> ExecuteProtocolAsync(IChannelHandle channel, CancellationToken cancellationToken)
        {
            if (_request.Collation != null)
            {
                throw new NotSupportedException("OP_UPDATE does not support collations.");
            }
            if (_request.ArrayFilters != null)
            {
                throw new NotSupportedException("OP_UPDATE does not support arrayFilters.");
            }
            if (_request.Hint != null)
            {
                throw new NotSupportedException("OP_UPDATE does not support hints.");
            }

            return(channel.UpdateAsync(
                       _collectionNamespace,
                       _messageEncoderSettings,
                       _writeConcern,
                       _request.Filter,
                       _request.Update.AsBsonDocument,
                       ElementNameValidatorFactory.ForUpdateType(_request.UpdateType),
                       _request.IsMulti,
                       _request.IsUpsert,
                       cancellationToken));
        }
コード例 #2
0
 // methods
 private Task <WriteConcernResult> ExecuteProtocolAsync(IChannelHandle channel, CancellationToken cancellationToken)
 {
     return(channel.UpdateAsync(
                _collectionNamespace,
                _messageEncoderSettings,
                _writeConcern,
                _request.Filter,
                _request.Update,
                ElementNameValidatorFactory.ForUpdateType(_request.UpdateType),
                _request.IsMulti,
                _request.IsUpsert,
                cancellationToken));
 }
コード例 #3
0
        // methods
        protected override Task <WriteConcernResult> ExecuteProtocolAsync(IChannelHandle channel, WriteRequest request, CancellationToken cancellationToken)
        {
            var updateRequest = (UpdateRequest)request;

            return(channel.UpdateAsync(
                       CollectionNamespace,
                       MessageEncoderSettings,
                       WriteConcern,
                       updateRequest.Filter,
                       updateRequest.Update,
                       ElementNameValidatorFactory.ForUpdateType(updateRequest.UpdateType),
                       updateRequest.IsMulti,
                       updateRequest.IsUpsert,
                       cancellationToken));
        }
コード例 #4
0
        protected override Task<WriteConcernResult> ExecuteProtocolAsync(IChannelHandle channel, WriteRequest request, CancellationToken cancellationToken)
        {
            var updateRequest = (UpdateRequest)request;

            return channel.UpdateAsync(
                CollectionNamespace,
                MessageEncoderSettings,
                WriteConcern,
                updateRequest.Filter,
                updateRequest.Update,
                ElementNameValidatorFactory.ForUpdateType(updateRequest.UpdateType),
                updateRequest.IsMulti,
                updateRequest.IsUpsert,
                cancellationToken);
        }
コード例 #5
0
        protected override Task<WriteConcernResult> ExecuteProtocolAsync(IChannelHandle channel, WriteRequest request, CancellationToken cancellationToken)
        {
            var updateRequest = (UpdateRequest)request;
            if (updateRequest.Collation != null)
            {
                throw new NotSupportedException("BulkUpdateOperationEmulator does not support collations.");
            }

            return channel.UpdateAsync(
                CollectionNamespace,
                MessageEncoderSettings,
                WriteConcern,
                updateRequest.Filter,
                updateRequest.Update,
                ElementNameValidatorFactory.ForUpdateType(updateRequest.UpdateType),
                updateRequest.IsMulti,
                updateRequest.IsUpsert,
                cancellationToken);
        }
コード例 #6
0
        protected override Task <WriteConcernResult> ExecuteProtocolAsync(IChannelHandle channel, WriteRequest request, CancellationToken cancellationToken)
        {
            var updateRequest = (UpdateRequest)request;

            if (updateRequest.Collation != null)
            {
                throw new NotSupportedException("BulkUpdateOperationEmulator does not support collations.");
            }

            return(channel.UpdateAsync(
                       CollectionNamespace,
                       MessageEncoderSettings,
                       WriteConcern,
                       updateRequest.Filter,
                       updateRequest.Update,
                       ElementNameValidatorFactory.ForUpdateType(updateRequest.UpdateType),
                       updateRequest.IsMulti,
                       updateRequest.IsUpsert,
                       cancellationToken));
        }