我使用風帆0.10.5,我有兩個模型,如下面的許多關係。但我在解除應用程序時出錯。風帆mongo多對多協會不工作
模型1)Category.js
attributes: {
name: {
type: 'string',
required: true
},
features: {
type: 'array'
},
desc: {
type: 'string'
},
sub_cats: {
collection: 'SubCategory',
via: 'cats',
dominant: true
}
}
模型2)SubCategory.js
attributes: {
cats: {
collection: 'Category',
via: 'sub_cats'
},
name: {
type: 'string',
required: true
},
features: {
type: 'array'
},
desc: {
type: 'string'
}
}
現在同時擡起帆的應用程序,該錯誤始終觸發
"C:\Program Files (x86)\JetBrains\PhpStorm 8.0.2\bin\runnerw.exe" "C:\Program Files\nodejs\node.exe" app.js
c:\wamp\www\holymantra\hm\node_modules\sails\node_modules\waterline\node_modules\waterline-schema\lib\waterline-schema\utils.js:47
return hop.call(obj, prop);
^
TypeError: Cannot convert null to object
at hasOwnProperty (native)
at exports.object.hasOwnProperty (c:\wamp\www\holymantra\hm\node_modules\sails\node_modules\waterline\node_modules\waterline-schema\lib\waterline-schema\utils.js:47:14)
at JoinTables.parseAttribute (c:\wamp\www\holymantra\hm\node_modules\sails\node_modules\waterline\node_modules\waterline-schema\lib\waterline-schema\joinTables.js:148:26)
at c:\wamp\www\holymantra\hm\node_modules\sails\node_modules\waterline\node_modules\waterline-schema\lib\waterline-schema\joinTables.js:83:22
at Array.forEach (native)
所以我很困惑(我的代碼錯誤或存在帆 - 蒙戈多對多的關係有些問題)
--ND
雅你是對的,但我仍然有同樣的錯誤:( – 2015-02-11 04:53:42
你可以嘗試啓動應用程序與'帆升降機或節點app.js'從控制檯? – irobert91 2015-02-11 20:29:15
@NishchitDhanani和你有任何其他模型? – irobert91 2015-02-12 07:14:27