Below is the collection
public final class RLMHSDrugLookup: Object, Codable {
@Persisted(primaryKey: true) public var id : Int
@Persisted public var name : String
@Persisted public var generic: RLMHSDrugLookup?
}
From this collection I need to get all records where name OR generic.name matches to any element in this array [abc, xyz, pqr]
I am planning to write a filter using predicate some thing like below
NSPredicate(format: "name IN %@ OR generic.name IN %@ ",interactingIngredients,interactingIngredients)
Is there any other better ways to get data here other than this query?