Hi, I create two classes like this
```@class Person;
@interface Dog : RLMObject
@property NSString *name;
@property NSString *owner;
@property NSInteger age;
@property NSDate *picture;
@end
RLM_ARRAY_TYPE(Dog) // define RLMArray
@interface Person : RLMObject
@property NSString *name;
@property NSDate *birthdate;
@property RLMArray
@end
```
and I want to search result when person.name=Rex and Dog.name=Jack which like sql select * from Person as P join Dog as D where p.name = Rex and D.name = Jack
@hanjt Realm doesn't have a concept of join in SQL. Instead, Realm has a native link that stores objects including relations. So you don't need join query for Realm. What you want can be achieved with the following query:
[Person objectsWhere:@"name = %@ and any dogs.name = %@", @"Rex", @"Jack"];
Hi @hanjt! I hope @kishikawakatsumi's answer was able to help you.
I'm going to close this issue now. Please feel free to re-open this issue if you have any follow-up. Thanks!
Most helpful comment
@hanjt Realm doesn't have a concept of join in SQL. Instead, Realm has a native link that stores objects including relations. So you don't need join query for Realm. What you want can be achieved with the following query: