44using CouchDB . Driver . ChangesFeed . Filters ;
55using CouchDB . Driver . Types ;
66
7- namespace CouchDB . Driver . ChangesFeed
7+ namespace CouchDB . Driver . ChangesFeed ;
8+
9+ /// <summary>
10+ /// Represent a filter for the changes feed.
11+ /// </summary>
12+ public class ChangesFeedFilter
813{
914 /// <summary>
10- /// Represent a filter for the changes feed .
15+ /// Create a filter for document IDs .
1116 /// </summary>
12- [ System . Diagnostics . CodeAnalysis . SuppressMessage ( "Design" , "CA1052:Static holder types should be Static or NotInheritable" , Justification = "<Pending>" ) ]
13- public class ChangesFeedFilter
14- {
15- /// <summary>
16- /// Create a filter for document IDs.
17- /// </summary>
18- /// <param name="documentIds">The document IDs to use as filters.</param>
19- /// <returns></returns>
20- public static ChangesFeedFilter DocumentIds ( IList < string > documentIds )
21- => new DocumentIdsChangesFeedFilter ( documentIds ) ;
17+ /// <param name="documentIds">The document IDs to use as filters.</param>
18+ /// <returns></returns>
19+ public static ChangesFeedFilter DocumentIds ( IList < string > documentIds )
20+ => new DocumentIdsChangesFeedFilter ( documentIds ) ;
2221
23- /// <summary>
24- /// Create a filter using the same syntax used to query.
25- /// </summary>
26- /// <remarks>
27- /// This is significantly more efficient than using a JavaScript filter function and is the recommended option if filtering on document attributes only.
28- /// </remarks>
29- /// <typeparam name="TSource">The type of database documents.</typeparam>
30- /// <param name="selector">The function used to filter.</param>
31- /// <returns></returns>
32- public static ChangesFeedFilter Selector < TSource > ( Expression < Func < TSource , bool > > selector ) where TSource : CouchDocument
33- => new SelectorChangesFeedFilter < TSource > ( selector ) ;
22+ /// <summary>
23+ /// Create a filter using the same syntax used to query.
24+ /// </summary>
25+ /// <remarks>
26+ /// This is significantly more efficient than using a JavaScript filter function and is the recommended option if filtering on document attributes only.
27+ /// </remarks>
28+ /// <typeparam name="TSource">The type of database documents.</typeparam>
29+ /// <param name="selector">The function used to filter.</param>
30+ /// <returns></returns>
31+ public static ChangesFeedFilter Selector < TSource > ( Expression < Func < TSource , bool > > selector ) where TSource : CouchDocument
32+ => new SelectorChangesFeedFilter < TSource > ( selector ) ;
3433
35- /// <summary>
36- /// Create a filter that accepts only changes for any design document within the requested database.
37- /// </summary>
38- /// <returns></returns>
39- public static ChangesFeedFilter Design ( )
40- => new DesignChangesFeedFilter ( ) ;
34+ /// <summary>
35+ /// Create a filter that accepts only changes for any design document within the requested database.
36+ /// </summary>
37+ /// <returns></returns>
38+ public static ChangesFeedFilter Design ( )
39+ => new DesignChangesFeedFilter ( ) ;
4140
42- /// <summary>
43- /// Create a filter that uses an existing map function to the filter.
44- /// </summary>
45- /// <remarks>
46- /// If the map function emits anything for the processed document it counts as accepted and the changes event emits to the feed.
47- /// </remarks>
48- /// <param name="view">The view.</param>
49- /// <returns></returns>
50- public static ChangesFeedFilter View ( string view )
51- => new ViewChangesFeedFilter ( view ) ;
41+ /// <summary>
42+ /// Create a filter that uses an existing map function to the filter.
43+ /// </summary>
44+ /// <remarks>
45+ /// If the map function emits anything for the processed document it counts as accepted and the changes event emits to the feed.
46+ /// </remarks>
47+ /// <param name="view">The view.</param>
48+ /// <returns></returns>
49+ public static ChangesFeedFilter View ( string view )
50+ => new ViewChangesFeedFilter ( view ) ;
5251
53- /// <summary>
54- /// Create a filter using a design document filter function with optional query parameters.
55- /// </summary>
56- /// <remarks>
57- /// The filter function in the design document can access query parameters via <c>req.query</c>.
58- /// This is useful for passing partition keys or other custom filtering parameters.
59- /// </remarks>
60- /// <param name="filterName">The filter name in format "designdoc/filtername" (e.g., "replication/by_partition").</param>
61- /// <param name="queryParameters">Optional query parameters to pass to the filter function.</param>
62- /// <returns></returns>
63- public static ChangesFeedFilter DesignDocument ( string filterName , Dictionary < string , string > ? queryParameters = null )
64- => new DesignDocumentChangesFeedFilter ( filterName , queryParameters ) ;
65- }
66- }
52+ /// <summary>
53+ /// Create a filter using a design document filter function with optional query parameters.
54+ /// </summary>
55+ /// <remarks>
56+ /// The filter function in the design document can access query parameters via <c>req.query</c>.
57+ /// This is useful for passing partition keys or other custom filtering parameters.
58+ /// </remarks>
59+ /// <param name="filterName">The filter name in format "designdoc/filtername" (e.g., "replication/by_partition").</param>
60+ /// <param name="queryParameters">Optional query parameters to pass to the filter function.</param>
61+ /// <returns></returns>
62+ public static ChangesFeedFilter DesignDocument ( string filterName , Dictionary < string , string > ? queryParameters = null )
63+ => new DesignDocumentChangesFeedFilter ( filterName , queryParameters ) ;
64+ }
0 commit comments