Katedral Pillon Katedral Pillon - 10 months ago 103
Java Question

Objectify Projection Query with Filters

Given the class

public class Goat{
Long pen;
Long car;
Boolean active;


I need to create a projection query that returns a list of
s. How should I edit the following so it works?

List<Long> cars = ofy().load().type(Goat.class).filter("pen", pen).filter("active", true).project("car").list();

Answer Source

You need to index all fields you plan to query/filter on. eg.

 Long pen;
 Long car;