Reputation: 45
On the following object model:
// Dog model
class Dog: RLMObject {
var name = ""
var owner = Person()
}
// Person model
class Person: RLMObject {
name = ""
birthdate = NSDate(timeIntervalSince1970: 1)
dogs = RLMArray(objectClassName: Dog.className())
}
is it possible to query for all person's who have a dog whose name starts with 'B' i.e. something like
Person.objectsWhere("ANY dogs.name name BEGINSWITH 'B'")
I have tried it, doesn't seem to work on realm-cocoa 0.89.1
Upvotes: 1
Views: 303
Reputation: 14086
This should work, you have an extra name in the predicate statement, it should read like this:
Person.objectsWhere("ANY dogs.name BEGINSWITH 'B'")
Upvotes: 2