lundi 30 juillet 2018

Laravel fetching JSON column dollar sign

Im trying to fetch some datas depending on the JSON column meta. However, something weirds happen around the -> symbol.

File::whereJsonContains('meta->serie', 'value')->toSql();

output

"select * from `files` where json_contains(`meta`->'$.\"serie\"', ?)"

Here is the error I get

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '>'$."serie"', ?)' at line 1 (SQL: select * from files where json_contains(meta->'$."serie"', "check_up"))

I tried using a regular where but it throws the same error. Any idea?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2LQ9HRF
via IFTTT

Aucun commentaire:

Enregistrer un commentaire