I have an object called Guy which has an attribute girlfriends type Key[]
Given a list of Longs which are the Girl's ids I want to query all the Guy's which have any of these girls as girlfriend.
For example (Guy: gilfriends):
LuckyGuy: {a,b,c}
Guy1: {b}
Guy2: {c}
I want g such as:
g({a,b}) = LuckyGuy, Guy1
g({c})) = LuckyGuy, Guy2
I could make a loop:
for(i..n)
resultSet.add(
objectifyFactory.begin().load().type(User.class).filter("girlfriends", girlfriendId[i])
);
But I'm sure there is a direct strategy.
Any idea?
The datastore does not support 'or' queries. You will need to query for each of the 'girlfriend' IDs separately, and combine the result sets.
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