Backendless Support
 
Answered

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

For example:

Lightsaber

  1. class Lightsaber: NSObject {
  2. var color: String?
  3. var strengths: [Strength] = []
  4. }

Strength

  1. class Strength: NSObject {
  2. var power: Int = 0
  3. var super: String?
  4. }

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

Leave a Comment

Comments (1)

photo
1

The following whereClause should do it:

  1. strengths.super = 'teleporting'

The query should be sent to the Lightsaber table.

Regards,

Mark