FilterQuery

public final class FilterQuery<EntryType>: AbstractQuery where EntryType: EntryModellable

An additional query to filter by the properties of linked objects when searching on references. See: https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters/search-on-references and see the init(whereLinkAt fieldNameForLink: String, matches filterQuery: FilterQuery? = nil) methods on QueryOn for example usage.

  • The parameters dictionary that are converted to URLComponents (HTTP parameters/arguments) on the HTTP URL. Useful for debugging.

    Declaration

    Swift

    public var parameters: [String: String] = [String: String]()
  • Convenience intializer for creating a QueryOn with a QueryOperation. Example usage:

    let filterQuery = FilterQuery<Cat>(where: "fields.name", .matches("Happy Cat"))
    let query = QueryOn<Cat>(whereLinkAt: "bestFriend", matches: filterQuery)
    

    Declaration

    Swift

    public convenience init(where name: String, _ operation: QueryOperation, for locale: String? = nil)

    Parameters

    name

    The name of the property you are performing the QueryOperation against. For instance, "sys.id" or "fields.yourFieldName"

    operation

    the QueryOperation

    locale

    An optional locale argument to return localized results. If unspecified, the locale originally set on the Client instance is used.

  • Designated initializer for FilterQuery.

    Declaration

    Swift

    public init()