public OutputReduceToCollectionActions(MapReduceIndex index)
        {
            _index = index;

            Debug.Assert(string.IsNullOrEmpty(index.Definition.OutputReduceToCollection) == false);

            _collectionOfReduceOutputs = index.Definition.OutputReduceToCollection;
            _reduceOutputVersion       = index.Definition.ReduceOutputIndex;

            if (string.IsNullOrEmpty(index.Definition.PatternForOutputReduceToCollectionReferences) == false)
            {
                _patternForOutputReduceToCollectionReferences = new OutputReferencesPattern(index.Definition.PatternForOutputReduceToCollectionReferences);
            }
        }
        public DeleteReduceOutputDocumentsCommand(DocumentDatabase database, string documentsPrefix, string originalPattern, int batchSize) : base(database)
        {
            if (OutputReduceToCollectionCommand.IsOutputDocumentPrefix(documentsPrefix) == false)
            {
                throw new ArgumentException($"Invalid prefix to delete: {documentsPrefix}", nameof(documentsPrefix));
            }

            _documentsPrefix = documentsPrefix;
            _batchSize       = batchSize;

            if (string.IsNullOrEmpty(originalPattern) == false)
            {
                _originalPattern = originalPattern;
                _originalPatternForReduceOutputReferences = new OutputReferencesPattern(database, originalPattern);
            }
        }