2017-07-06 21 views
0

我使用下面的架構時失敗。因爲它們最終將包含獨特的數據。 正規化部分和預期一樣,但是當我嘗試進行非規範化的數據備份失敗與以下錯誤:去正規化試圖用idAttribute生成ID

TypeError: Cannot read property 'id' of undefined 
    at EntitySchema.idAttribute (http://localhost:4040/main.bundle.js:3782:59) 
    at EntitySchema.getId (http://localhost:4040/vendor.bundle.js:70706:19) 
    at unvisitEntity (http://localhost:4040/vendor.bundle.js:4787:19) 
    at unvisit (http://localhost:4040/vendor.bundle.js:4821:14) 
    at http://localhost:4040/vendor.bundle.js:70589:12 
    at Array.map (native) 
    at denormalize (http://localhost:4040/vendor.bundle.js:70588:37) 

請幫助非規範化的數據備份。

所有我在這個階段做的是:

const normalized = normalize(payload, norm.experience); 
const denorm = denormalize(normalized.result, norm.experience, normalized.entities) 

我可以提供輸入數據,以及根據需求,它是有點大。

回答