コード例 #1
0
        protected override Task<WriteConcernResult> ExecuteProtocolAsync(IChannelHandle channel, WriteRequest request, CancellationToken cancellationToken)
        {
            var deleteRequest = (DeleteRequest)request;
            var isMulti = deleteRequest.Limit == 0;

            return channel.DeleteAsync(
               CollectionNamespace,
               deleteRequest.Filter,
               isMulti,
               MessageEncoderSettings,
               WriteConcern,
               cancellationToken);
        }
コード例 #2
0
        protected override Task<WriteConcernResult> ExecuteProtocolAsync(IChannelHandle channel, WriteRequest request, CancellationToken cancellationToken)
        {
            var deleteRequest = (DeleteRequest)request;
            var isMulti = deleteRequest.Limit == 0;
            if (deleteRequest.Collation != null)
            {
                throw new NotSupportedException("OP_DELETE does not support collations.");
            }

            return channel.DeleteAsync(
               CollectionNamespace,
               deleteRequest.Filter,
               isMulti,
               MessageEncoderSettings,
               WriteConcern,
               cancellationToken);
        }
コード例 #3
0
        protected override Task <WriteConcernResult> ExecuteProtocolAsync(IChannelHandle channel, WriteRequest request, CancellationToken cancellationToken)
        {
            var deleteRequest = (DeleteRequest)request;
            var isMulti       = deleteRequest.Limit == 0;

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

            return(channel.DeleteAsync(
                       CollectionNamespace,
                       deleteRequest.Filter,
                       isMulti,
                       MessageEncoderSettings,
                       WriteConcern,
                       cancellationToken));
        }
コード例 #4
0
        private Task <WriteConcernResult> ExecuteProtocolAsync(IChannelHandle channel, CancellationToken cancellationToken)
        {
            if (_request.Collation != null)
            {
                throw new NotSupportedException("OP_DELETE does not support collations.");
            }
            if (_request.Hint != null)
            {
                throw new NotSupportedException("OP_DELETE does not support hints.");
            }

            return(channel.DeleteAsync(
                       _collectionNamespace,
                       _request.Filter,
                       _request.Limit != 1,
                       _messageEncoderSettings,
                       _writeConcern,
                       cancellationToken));
        }