Example #1
0
        private WriteConcernResult ExecuteProtocol(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.Update(
                       _collectionNamespace,
                       _messageEncoderSettings,
                       _writeConcern,
                       _request.Filter,
                       _request.Update.AsBsonDocument,
                       ElementNameValidatorFactory.ForUpdateType(_request.UpdateType),
                       _request.IsMulti,
                       _request.IsUpsert,
                       cancellationToken));
        }
 private WriteConcernResult ExecuteProtocol(IChannelHandle channel, CancellationToken cancellationToken)
 {
     return(channel.Update(
                _collectionNamespace,
                _messageEncoderSettings,
                _writeConcern,
                _request.Filter,
                _request.Update,
                ElementNameValidatorFactory.ForUpdateType(_request.UpdateType),
                _request.IsMulti,
                _request.IsUpsert,
                cancellationToken));
 }
        // methods
        protected override WriteConcernResult ExecuteProtocol(IChannelHandle channel, WriteRequest request, CancellationToken cancellationToken)
        {
            var updateRequest = (UpdateRequest)request;

            return channel.Update(
                CollectionNamespace,
                MessageEncoderSettings,
                WriteConcern,
                updateRequest.Filter,
                updateRequest.Update,
                ElementNameValidatorFactory.ForUpdateType(updateRequest.UpdateType),
                updateRequest.IsMulti,
                updateRequest.IsUpsert,
                cancellationToken);
        }
        // methods
        protected override WriteConcernResult ExecuteProtocol(IChannelHandle channel, WriteRequest request, CancellationToken cancellationToken)
        {
            var updateRequest = (UpdateRequest)request;

            return(channel.Update(
                       CollectionNamespace,
                       MessageEncoderSettings,
                       WriteConcern,
                       updateRequest.Filter,
                       updateRequest.Update,
                       ElementNameValidatorFactory.ForUpdateType(updateRequest.UpdateType),
                       updateRequest.IsMulti,
                       updateRequest.IsUpsert,
                       cancellationToken));
        }
        // methods
        protected override WriteConcernResult ExecuteProtocol(IChannelHandle channel, WriteRequest request, CancellationToken cancellationToken)
        {
            var updateRequest = (UpdateRequest)request;
            if (updateRequest.Collation != null)
            {
                throw new NotSupportedException("BulkUpdateOperationEmulator does not support collations.");
            }

            return channel.Update(
                CollectionNamespace,
                MessageEncoderSettings,
                WriteConcern,
                updateRequest.Filter,
                updateRequest.Update,
                ElementNameValidatorFactory.ForUpdateType(updateRequest.UpdateType),
                updateRequest.IsMulti,
                updateRequest.IsUpsert,
                cancellationToken);
        }
Example #6
0
        // methods
        protected override WriteConcernResult ExecuteProtocol(IChannelHandle channel, WriteRequest request, CancellationToken cancellationToken)
        {
            var updateRequest = (UpdateRequest)request;

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

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