MatchFilterInput (Input)
Description
MatchFilterInput class is used to filter fields of various types. It allows specifying different conditions such as equality, text containment, range, geo-bounding box, geo-radius, values count, null check, and emptiness check. Each match filter represents a single condition applied to a specific field. For example, instead of title is 'hello', you would use {key: "title", is: ""hello""}
Fields
Name | Description |
---|---|
any - [String!] | Filter to match any of the provided values (values should be JSON strings). For example, {key: "status", any: ["\"active\"", "\"pending\""]} will match records where the status field is either "active" or "pending". |
containsText - String | Filter to check if the text contains a specific string. For example, {key: "description", containsText: "example"} will match records where the description field contains the string "example". |
doesNotContainText - String | Filter to check if the text does not contain a specific string. For example, {key: "description", doesNotContainText: "example"} will match records where the description field does not contain the string "example". |
except - [String!] | Filter to exclude all of the provided values (values should be JSON strings). For example, {key: "status", except: ["\"inactive\"", "\"banned\""]} will match records where the status field is neither "inactive" nor "banned". |
geoBoundingBox - GeoBoundingBoxInput | Filter to match a geographical bounding box. For example, {key: "location", geoBoundingBox: {topLeft: {lat: 40.73, lon: -74.1}, bottomRight: {lat: 40.01, lon: -71.12}}} will match records where the location field is within the specified bounding box. |
geoRadius - GeoRadiusInput | Filter to match a geographical radius. For example, {key: "location", geoRadius: {center: {lat: 40.73, lon: -74.1}, radius: 10}} will match records where the location field is within a 10 km radius of the specified center point. |
is - String | Filter to match the exact value (value should be a JSON string). For example, {key: "title", is: "\"hello\""} will match records where the title field is exactly "hello". |
isEmpty - Boolean | Filter to check if the field value is empty (for strings or arrays). For example, {key: "comments", isEmpty: true} will match records where the comments field (an array) is empty. |
isNot - String | Filter to exclude the exact value (value should be a JSON string). For example, {key: "title", isNot: "\"hello\""} will match records where the title field is not "hello". |
isNull - Boolean | Filter to check if the field value is null. For example, {key: "deletedAt", isNull: true} will match records where the deletedAt field is null. |
key - String! | Field key to apply the filter on. This specifies which field the condition will be applied to. |
range - RangeInput | Filter to match a range of dates or numbers (each value should be a JSON string). For example, {key: "age", range: {gte: "18", lte: "30"}} will match records where the age field is between 18 and 30 inclusive. For dates, {key: "createdAt", range: {gte: "2022-01-01", lte: "2022-12-31"}} will match records where the createdAt field is between January 1, 2022, and December 31, 2022 inclusive. |
valuesCount - ValuesCountInput | Filter to match the count of values in an array. For example, {key: "tags", valuesCount: {gte: 3}} will match records where the tags field (an array) has 3 or more values. |
input MatchFilterInput {
any: [String!]
containsText: String
doesNotContainText: String
except: [String!]
geoBoundingBox: GeoBoundingBoxInput
geoRadius: GeoRadiusInput
is: String
isEmpty: Boolean
isNot: String
isNull: Boolean
key: String!
range: RangeInput
valuesCount: ValuesCountInput
}