Filters
As was mentioned earlier, it's possible to follow a
backlink by using the .<
instead of .
. When doing
that it's also necessary to specify the type of the
object at the start using [is SomeType]
if you want to
access any of the links or properties. This can be used
in a filter as well. For example, to get all movies from
Alice's watchlist
, try:
A plain English equivalent of the above query would be:
"Show all Movie
objects and their titles that Account
objects link to via their watchlist
link if the Account
object's username
property is 'Alice'"
The filter expression must evaluate to some boolean
value or a set of boolean values for each element of the
filtered set. If it evaluates to a set of booleans all
objects that have at least one true
value in their
filter expression set will be included. This is why
filtering movies by matching the name
of one of the actors
can be done like this:
...or like this:
You can use more complex expressions to filter the results. The only condition is that it should be possible to evaluate these expressions for each element (typically an object) of the filtered set. Try the following query for selecting movies that have titles starting with "The" or star Scarlett Johansson: