6
我有一個Bookshelf的問題,我想使用查詢列json類型 我的表有'數據'類型的json類型,我想要在這個列'團隊'中獲取所有元素= 'PSG'Bookshelf.js與json列在哪裏Postgresql
我測試:
collection.query('whereRaw', "data->'team'->>'PSG'");
我有這樣的錯誤
"argument of WHERE must be type boolean, not type text"
或I測試
collection.query('where', "data", "#>", "'{team, PSG}'");
我有這樣的錯誤
"The operator \"#>\" is not permitted"
我認爲有一個報告https://github.com/tgriesser/bookshelf/issues/550
我正在使用相同的查詢,但仍然出錯,'未處理的拒絕錯誤:從「foo」中選擇「foo」*,其中「attr」@> $ 1限制$ 2 - 運算符不存在:json @> unknown '。 – Vasanth
你可以用調試標誌運行你的knex查詢併發布你的確切查詢嗎? –