var ParentModel = bookshelf.Model.extend({ });
var ChildModel = ParentModel.extend({ });
new ChildModel().fetch().then(function(child){
console.log(child.get('parentAttribute')); //undefined
我有一個Bookshelf的問題,我想使用查詢列json類型 我的表有'數據'類型的json類型,我想要在這個列'團隊'中獲取所有元素= 'PSG' 我測試: collection.query('whereRaw', "data->'team'->>'PSG'");
我有這樣的錯誤 "argument of WHERE must be type boolean, not type text"
我對bookshelf.js相當陌生,請耐心等待。 因爲我在學習,所以我使用MySQL並且有一個非常簡單的結構。即,兩個實體,一個輔助鍵。這裏是我的結構: CREATE TABLE IF NOT EXISTS `city` (
`city_id` int(11) NOT NULL,
`code` int(11) NOT NULL,
`name` varchar(255)
假設我們有一個連接表vehicle_inspections和另一個連接表inspection_actions,以及actions,vehicles, and檢查的基本表。 可以說,我的願望以下DB條目: vehicles
----------------------------
id make
----------------------------
1 Toyota
act