我可以在 MariaDB 10.2.16 LongText 列中使用 Laravel JSON Where 子句吗?

Can I use Laravel JSON Where Clauses with MariaDB 10.2.16 LongText column?

我尝试使用 phpMyAdmin

将 json 列添加到我的数据库

但不幸的是,phpMyAdmin 将 json 列转换为 Longtext 类型

所以,我问的是使用 JSON 这种类型的 Where 子句的能力

https://laravel.com/docs/5.7/queries#json-where-clauses

您不能在 MariaDB 中对非 JSON 数据类型使用这些查询。并且从10.2开始,还没有正式支持。

您可以使用 JSON helper functions 查询数据(即:where JSON_CONTAINS(...) 和其他。

您还可以使用 Virtual Columns

创建从 JSON 数据中提取值的列

这里有一个 good post 更详细。