這個問題過濾數據存儲的結果早有答案爲Python: How to get all records from GAE datastore with particular parent?由母公司
我怎麼做進去嗎?我想這樣做:
t := new(TagRecord)
k, err := datastore.DecodeKey(r.URL.Path[1:])
...
_, err = datastore.NewQuery("TagRecord").
Filter("Parent =", k).
Order("-CreatedAt").
Limit(1).
Run(c).Next(t)
...但是這並出現以下錯誤悲慘的失敗了:
datastore: query has no more results
當我嘗試過濾其它特性,包括硬編碼到過濾器和那些通過URL傳遞的查詢會正確運行並使用適當的屬性填充t。用什麼羞恥的簡單來解決我的問題?