客体是一种简单包装的低级别的数据存储API,所以在操作者的行为一样的低级别的API:
ofy.query(Schedule.class).filter("paper IN", listOfPaperKeys).filter("scheduledDate = ", someDate)
这是假设你的Schedule
类具有包含列表字段List<Key> paper
指向Paper
实体的键(如果您使用物体的类型安全的Key
s,也可以有List<Key<Paper>> paper
)。
请注意IN
如何在引擎盖下执行一系列查询并合并结果。因此在某种意义上它表现为一系列“=”运算符,其结果被合并:
The IN operator also performs multiple queries, one for each item in the
specified list, with all other filters the same and the IN filter replaced with
an EQUAL filter. The results are merged, in the order of the items in the list.
If a query has more than one IN filter, it is performed as multiple queries,
one for each possible combination of values in the IN lists.