Overview
The CommonGrants.Filters
namespace contains a series of basic filters that can be used to define both standard and custom filtering within
Filters
Section titled “Filters”Learn more about the default filters supported by the CommonGrants protocol:
Base filter and operators
Section titled “Base filter and operators” Equivalence Operators Filter by exact match to a value
Comparison Operators Filter by comparison to a value
Array Operators Filter by by a collection of values
String Operators Filter by string operation (like, not like)
Range Operators Filter by a range of values
String
Section titled “String” String Comparison Filter Filter by string comparison
String Array Filter Filter by string array membership
Numeric
Section titled “Numeric” Number Comparison Filter Compare a field to a numeric value
Number Range Filter Compare a field to a range of numeric values
Number Array Filter Compare a field to an array of numeric values
Money Comparison Filter Compare a field to a monetary value
Money Range Filter Compare a field to a range of monetary values
Date and time
Section titled “Date and time” Date Comparison Filter Compare a field to a date value
Date Range Filter Compare a field to a range of date values
You can use the types listed above to define custom models in your TypeSpec project.
import "@common-grants/core"
// Exposes the `Types` namespace so that it can be accessed// without a `CommonGrants` prefixusing CommonGrants;
model MyModel { id: Types.uuid; // CommonGrants-defined type description: string; // Standard TypeSpec type tags: Array<string>; // A templated type createdAt: utcDateTime;}