【发布时间】:2014-04-04 18:22:27
【问题描述】:
datastore.GetMulti(c appengine.Context, key []*Key, dst interface{}) API 最多允许我获取 1000 个实体。我想得到更多。
解决这个问题的一个明显方法是创建一个包装函数 mypkg.GetMulti(),它对原始参数进行子切片 (key[0:1000], key[1000:2000]...) 并使用它们多次调用 datastore.GetMulti()。
很清楚如何对key []*Key 进行子切片,但我如何对dst interface{} 进行子切片,这可能是:
// dst must be a []S, []*S, []I or []P, for some struct type S, some interface
// type I, or some non-interface non-pointer type P such that P or *P
// implements PropertyLoadSaver. If an []I, each element must be a valid dst
// for Get: it must be a struct pointer or implement PropertyLoadSaver.
//
// As a special case, PropertyList is an invalid type for dst, even though a
// PropertyList is a slice of structs. It is treated as invalid to avoid being
// mistakenly passed when []PropertyList was intended.
【问题讨论】:
标签: google-app-engine go