I'm using Realm 2.0 (Swift). My model is composed of X
and Y
(classes). X
has a property called list
which is a Realm List of Y
objects.
Let's assume I have an instance of a Y
object, called y
The query I'm looking for is:
y
in it's list of Y
objects?If the list was just a list of strings, I assume this would be trivial as the query would be: realm.objects(X.self).filter("<string> IN list")
Thanks :-)
You can express this as either:
realm.objects(X.self).filter("%@ IN list", y)
or:
realm.objects(X.self).filter("ANY list = %@", y)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With