Support Topics Documentation Slack YouTube Blog

Search in a relational array (one-to-many relationship)

For example:

Lightsaber

class Lightsaber: NSObject {
var color: String?
var strengths: [Strength] = []
}

Strength

class Strength: NSObject {
var power: Int = 0
var super: String?
}

How would i find lightsabers that have the super of teleporting?

The following whereClause should do it:

strengths.super = 'teleporting'

The query should be sent to the Lightsaber table.

Regards,
Mark