FilterDocuments Class
Filters the current sequence of documents using a predicate.
Namespace
Statiq.Core
Interfaces
Base Types
graph BT Type-->Base0["Module"] click Base0 "/api/Statiq.Common/Module" Base0-->Base1["object"] Type-.->Interface0["IModule"] click Interface0 "/api/Statiq.Common/IModule" Type["FilterDocuments"] class Type type-node

Syntax

public class FilterDocuments : Module, IModule

Remarks

This module filters documents using "or" logic. If you want to also apply "and" conditions, place additional FilterDocuments modules after this one.

Constructors

Name Summary
FilterDocuments() Creates a module to filter documents but applies no default filtering.
FilterDocuments(Config<bool>) Specifies the predicate to use for filtering documents. Only input documents for which the predicate returns true will be output.
FilterDocuments(string) Specifies a metadata key that must be present. Only input documents for which the key exists will be output.

Methods

Name Return Value Summary
AfterExecution(IExecutionContext, ExecutionOutputs) void
Called after each module execution.
Inherited from Module
AfterExecutionAsync(IExecutionContext, ExecutionOutputs) Task
Called after each module execution.
Inherited from Module
BeforeExecution(IExecutionContext) void
Called before each module execution.
Inherited from Module
BeforeExecutionAsync(IExecutionContext) Task
Called before each module execution.
Inherited from Module
ExecuteAsync(IExecutionContext) Task<IEnumerable<IDocument>>
This should not be called directly, instead call IExecutionContext.Execute() if you need to execute a module from within another module.
Inherited from Module
ExecuteContextAsync(IExecutionContext) Task<IEnumerable<IDocument>>
Executes the module once for all input documents.
ExecuteInputAsync(IDocument, IExecutionContext) Task<IEnumerable<IDocument>>
Executes the module.
Inherited from Module
Finally(IExecutionContext) void
Called after each module execution, even if an exception is thrown during execution.
Inherited from Module
FinallyAsync(IExecutionContext) Task
Called after each module execution, even if an exception is thrown during execution.
Inherited from Module
Or(Config<bool>) FilterDocuments
Applies an additional predicate to the filtering operation as an "or" condition.
Or(string) FilterDocuments
Checks for the presence of an additional key in the filtering operation as an "or" condition.

Extension Methods