2015-11-08 38 views
1

我有了2層嵌入結構(1個陣列和1層結構)一個實體EmergencyCase 當我嘗試通過調用保存EmergencyCase:轉到App Engine的嵌套對象沒有存儲在雲存儲

datastore.Put(c, key, &ec) 

一切除了Pos字段(類型Position)外,其他字段都可以正常存儲。沒有關於此的錯誤或日誌條目。它只是沒有存儲。有什麼建議麼?

這裏是我的3個實體的定義:

type Position struct{ 
    lon float32 
    lat float32 
} 
type EmergencyCase struct{ 
    // Autogenerated id, not stored in the database. 
    ID string `datastore:"-"` 
    CreatedAt time.Time 
    Closed bool 
    ClosedByUser bool `datastore:",noindex"` 
    AutoClosed bool `datastore:",noindex"` 
    Pos Position 
    Events []Event 
} 

type Event struct{ 
    // Autogenerated id, not stored in the datastore. 
    ID string `datastore:"-"` 
    CreatedAt time.Time 
    Name string `datastore:",noindex"` 
} 
+0

數據存儲區中不會有Pos字段,但是您將有lon/lat字段..是這種情況嗎? – MayK

+0

不,事實並非如此。 – user3603632

回答

相關問題