我有一個(gè)實(shí)體 EmergencyCase,它有 2 個(gè)嵌入式結(jié)構(gòu)(1 個(gè)數(shù)組和 1 個(gè)結(jié)構(gòu))當(dāng)我嘗試通過調(diào)用來保存 EmergencyCase 時(shí):datastore.Put(c, key, &ec)除了 Pos 字段(類型 Position)外,所有內(nèi)容都保存完好。沒有關(guān)于此的錯(cuò)誤或日志條目。它只是不存儲(chǔ)。有什么建議?這是我的 3 個(gè)實(shí)體定義: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"`}
Go App Engine 嵌套對(duì)象未存儲(chǔ)在 Cloud Datastore 中
動(dòng)漫人物
2021-11-22 15:10:47