【问题标题】:Doctrine query postgres json (contains) json_array教义查询 postgres json (包含) json_array
【发布时间】:2015-06-14 20:53:15
【问题描述】:

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

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

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

【问题讨论】:

标签: json postgresql symfony doctrine-orm


【解决方案1】:

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

希望这会有所帮助。

https://github.com/boldtrn/JsonbBundle

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

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

【讨论】:

  • 非常好,感谢您的捆绑。
  • 非常感谢您创建此捆绑包,过去 2 天都快疯了。
猜你喜欢
  • 2013-05-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-09-23
  • 2018-04-13
  • 2012-01-06
相关资源
最近更新 更多