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