Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
260 views
in Technique[技术] by (71.8m points)

mysql - How to filter elements with json contains ? then createQueryBuilder

I work on symfony with calls or createQueryBuilder I have a table like this one

+----+--------------+
| id | langs        |
+----+--------------+
|  1 | ["EN", "ES"] |
|  2 | ["ES"]       |
|  3 | ["EN", "FR"] |
|  4 | ["ES"]       |
+----+--------------+

Already understand the Query query before trying to translate it, I would like to make an order in this style ?

SELECT * FROM `project` WHERE JSON_CONTAINS(data?,'"FR"');

I would like a return like this

+----+--------------+
| id | langs        |
+----+--------------+
|  3 | ["EN", "FR"] |
+----+--------------+

If you have solutions for me, thank you

question from:https://stackoverflow.com/questions/65836502/how-to-filter-elements-with-json-contains-then-createquerybuilder

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...