客體是一種簡單包裝的低級別的數據存儲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.