

# Filter

A filter that selects documents in a connection mapping. All members are optional, and a document must match every condition in the filter. When a mapping has more than one filter, a document that matches any of them is selected. `updatedAfter`, `includeTags`, and `excludeTags` apply to all connection types. `createdAfter` applies only to `BEDROCK_KNOWLEDGE_BASE` connections; for other connection types it doesn't exclude any document. `fileType` and `maxDocumentSizeBytes` apply only to `BEDROCK_KNOWLEDGE_BASE` connections, and specifying either for another connection type fails with `ValidationException`. You can't specify both `includeTags` and `excludeTags` in one filter.

## Contents
<a name="API_Filter_Contents"></a>

 ** createdAfter **   <a name="context-Type-Filter-createdAfter"></a>
Documents created after this time match. Applies only to `BEDROCK_KNOWLEDGE_BASE` connections. For other connection types, it doesn't exclude any document.  
Type: Timestamp  
Required: No

 ** excludeTags **   <a name="context-Type-Filter-excludeTags"></a>
The tags to exclude: 1–25 strings, each 1–256 characters. Applies to all connection types. You can't specify both `excludeTags` and `includeTags` in one filter.  
Type: Array of strings  
Array Members: Minimum number of 1 item. Maximum number of 25 items.  
Length Constraints: Minimum length of 1. Maximum length of 256.  
Required: No

 ** fileType **   <a name="context-Type-Filter-fileType"></a>
The file type to match, for example PDF or DOCX. Applies only to BEDROCK\_KNOWLEDGE\_BASE connections.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 64.  
Pattern: `[A-Z][A-Z0-9_]*`   
Required: No

 ** includeTags **   <a name="context-Type-Filter-includeTags"></a>
The tags to include: 1–25 strings, each 1–256 characters. Applies to all connection types. You can't specify both `includeTags` and `excludeTags` in one filter.  
Type: Array of strings  
Array Members: Minimum number of 1 item. Maximum number of 25 items.  
Length Constraints: Minimum length of 1. Maximum length of 256.  
Required: No

 ** maxDocumentSizeBytes **   <a name="context-Type-Filter-maxDocumentSizeBytes"></a>
The maximum document size, in bytes. Applies only to BEDROCK\_KNOWLEDGE\_BASE connections. Documents larger than this are filtered out. If you omit it, there is no size limit. Range: 1 to 52,428,800 bytes (50 MiB).  
Type: Long  
Valid Range: Minimum value of 1. Maximum value of 52428800.  
Required: No

 ** updatedAfter **   <a name="context-Type-Filter-updatedAfter"></a>
Documents updated after this time match. Applies to all connection types.  
Type: Timestamp  
Required: No

## See Also
<a name="API_Filter_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/context-2022-07-26/Filter) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/context-2022-07-26/Filter) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/context-2022-07-26/Filter) 