I need to query Realm objects using a list of ids, id being the object's primary key. I have tried the following:
// Query a list of Dogs by their _ids
let doggoIds = ["1", "2", "3", "1", "2"]
realm.objects(Dog.self).filter("_id IN %@", doggoIds)
// Result: [Dog1, Dog2, Dog3]
The list of ids contains duplicates, but as you can see the result is a list of unique Dog objects.
I'm wondering if anyone can think of a different way to write this query so that we get a nice Results<Dog> collection from that list of ids that includes duplicates. Thanks!