getRelationships

abstract fun getRelationships(className: String): GetRelationships

List DataSync relationships of a class, optionally filtered by entity A and/or entity B. Optional filters/paging are set via the returned builder.

Filtering and sorting are only allowed on properties the relationship class marks as filterable via their filtering mode (none / simple / full), which also determines which of filterFast / filter / sort a property may be used with — see filterFast, filter, and sort for the exact per-parameter rules. The filterable set has no fixed default; it is whatever the supplied className declares as filterable payload properties (indexes over the relationship's /payload; the payload otherwise stays arbitrary JSON). In addition, the built-in fields id, createdAt, updatedAt, and status behave as full and are always filterable and sortable on any class, except that status may be excluded when the class declares it as a projected field and the token cannot fully reach it.

Results are scoped to the caller's access token: only relationships the token is permitted to read (get) are returned. Relationships the token cannot read are silently omitted — the call does not error and does not return a 403 for the un-readable relationships. Token scoping and the filterFast / filter / sort criteria are applied together, so the returned page never contains a relationship the token cannot read regardless of the other criteria. When the PubNub instance is configured with a secretKey (a trusted server-side deployment, never a client — the secretKey must not be shipped to clients), or when using a token whose grants cover the whole result set, no permission-based filtering is applied and all matching relationships are returned, subject only to filterFast / filter / sort and limit paging.

Parameters

className

Relationship class identifier.