I have this property in my Realm Object
var tags = List<Tag>()
"tags": [
{
"tagId": "80069",
"tagName": "A"
},
{
"tagId": "80070",
"tagName": "B"
},
{
"tagId": "80071",
"tagName": "C"
},
{
"tagId": "80073",
"tagName": "D"
}
]
I have a view controller that can filter out the tag.
So i have several buttons to toggle the filter. What I have done is i create an array for the filter for each of my button
var filteredList = [String]()
So, if i click Button A, it will append "A" to the filteredList array, and if I click Button B, it will append "B" to the filteredList array and so on
Currently this is my filter predicate
let realmFilteredList = self.realm.objects(MyDTO.self).filter("ANY tags.tagName IN %@", self.filteredList)
However, above predicate gives me wrong result, because if let's say i want to filter the tag with property "A,B,C,D" (exact ABCD), it will return me other tag that contain either A,B,C,or D.
How can I get the tag with exact "A,B,C,D" in my search predicate?
Any help given is highly appreciated.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…