该datastore.GetMulti(c appengine.Context, key []*Key, dst interface{})API可以让我得到最多1000元。我想得到更多。
一般解决这个问题的一个明显方法是创建一个包装函数mypkg.GetMulti(),它对key[0:1000], key[1000:2000]...原始参数进行子切片 ( ) 并datastore.GetMulti()使用它们多次调用。
很清楚如何 sub slice 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.
拉风的咖菲猫
相关分类