I have this code:
EntityIterable iterable = null;
if(authId== null) {
iterable = txn.find(entityType, "publicRead", true).skip(skip).take(limit);
} else {
iterable = txn.getAll(entityType)
.union(txn.find(entityType, "read(" + authId+ ")", true))
.union(txn.find(entityType, "publicRead", false))
.union(txn.find(entityType, "publicRead" ,true)).skip(skip).take(limit);
}
}
I'm trying to figure out a way to be able to get results based on this logic:
- If
publicRead
is true then return all Entities that have the property set to true (trivia)
The problems is this:
- If
authId
is present then retrieve all Entities withpublicRead = false && read(userIdauthIdRoleId) = true
orpublicRead = true && read(authId) = true
How can this be achieved with the Xodus API?