Book.connection.execute("SELECT books.content -> 'summaries' from books INNER JOIN authors where books.author_id = authors.id")
这就变成了'[\"summary 1\", \"summary 2\",...]'
(序列化的字符串数组),我如何将它们作为字符串数组输出?
Book.connection.execute("SELECT books.content -> 'summaries' from books INNER JOIN authors where books.author_id = authors.id")
这就变成了'[\"summary 1\", \"summary 2\",...]'
(序列化的字符串数组),我如何将它们作为字符串数组输出?
1条答案
按热度按时间irtuqstp1#
要将JSONB数组转换为“常规”数组,请在
Book.connection.execute
语句中使用以下查询: