Open
Description
Your Question
Is there a way to build an SQL query that searches multiple-values (not multiple keys) in a JSON array?
SELECT * FROM table WHERE JSON_CONTAINS(obj->'$.array_of_ints', [1,2,3]);
for: { "obj": {"array_of_ints":[1,2,3,4]} } the result will be TRUE.
Or:
SELECT * FROM table WHERE JSON_CONTAINS(obj->'$.array_of_ints', 2);
for: { "obj":{"array_of_ints":[1,2,3,4]} } the result will be TRUE.
The document you expected this should be explained
https://gorm.io/docs/data_types.html
Expected answer
Would like to know the methods to generate a JSON_CONTAINS SQL query using SQLBuilder
Metadata
Metadata
Assignees
Labels
No labels