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 OperatorsFilter by exact match to a value
Comparison OperatorsFilter by comparison to a value
Array OperatorsFilter by by a collection of values
String OperatorsFilter by string operation (like, not like)
Range OperatorsFilter by a range of values
String
Section titled “String”String Comparison FilterFilter by string comparison
String Array FilterFilter by string array membership
Numeric
Section titled “Numeric”Number Comparison FilterCompare a field to a numeric value
Number Range FilterCompare a field to a range of numeric values
Number Array FilterCompare a field to an array of numeric values
Money Comparison FilterCompare a field to a monetary value
Money Range FilterCompare a field to a range of monetary values
Date and time
Section titled “Date and time”Date Comparison FilterCompare a field to a date value
Date Range FilterCompare 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;}