json - Doctrine查询postgres json(包含)json_array

标签 json postgresql symfony doctrine-orm

json_array 类型的学说被保存到 postgres database > 9.2 as json datatype .

Postgres supports contains and lots of other operations在 json 数据类型上。是否有可能使用学说中的功能?

可能需要自定义 SQLWalker?如所述here .支持 JSONB 的自定义类型也不错。如所述here .这将提高查询 json 字段时的性能。或者是否有添加 json(b) 功能的自定义库,或者甚至可以使用 DQL

最佳答案

我创建了一个支持 jsonb 的 Symfony2 Bundle。

希望这对您有所帮助。

https://github.com/boldtrn/JsonbBundle

现在我更喜欢使用 NativQueries 而不是自定义 DQL 函数来查询我的 jsonb 字段。自定义函数在我的应用程序中太麻烦了。

所有内容也应记录在 Bundle 中。

关于json - Doctrine查询postgres json(包含)json_array,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29539370/

相关文章:

java - android json向文本添加超链接

javascript - 类型错误 : undefined is not an object (evaluating 'this.props' ) - React Native

python - 从嵌套的 JSON 数据中获取特定值

postgresql - 如何将计算保存为 PostgreSQL 表列中的默认值

php - 将实体添加到 Symfony Sonata Admin Bundle 仪表板

javascript - 循环Json,搜索相同的键结尾,删除键结尾并将其放入新对象中

postgresql - 在 plpgsql 中使用 CTE

python - django 管理数据库创建,在 sql 命令被弃用后

symfony - Twig:如何覆盖form_widget的id属性?

php - 交响乐。如何将参数传递给自定义表单字段类型?