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.
感谢您的帮助。如果您能够回答,我有[后续问题](http://stackoverflow.com/questions/22885336/passing-reflect-value-to-datastore-getmulti-in-google-app-engine)。 – Dan