I created a table for testing:
mysql> select * from mytable;
+----------------------------------------------------------------------+------------+
| product | category |
+----------------------------------------------------------------------+------------+
| [{"OrderId": 1, "productID": "1"}] | ["2", "3"] |
| [{"OrderId": 2, "productID": "1"}] | ["2", "3"] |
| [{"OrderId": 3, "productID": "1"}] | ["2", "3"] |
| [{"OrderId": 4, "productID": "1"}] | ["2", "3"] |
| [{"OrderId": 5, "productID": "1"}] | ["2", "3"] |
| [{"OrderId": 6, "productID": "1"}, {"OrderID": 7, "productID": "2"}] | ["2", "3"] |
+----------------------------------------------------------------------+------------+
Now I want to check if any product has an order for productID 2?
mysql> select json_contains(json_extract(product, '$[*].productID'), '["2"]') as `product_2_present` from mytable;
+-------------------+
| product_2_present |
+-------------------+
| 0 |
| 0 |
| 0 |
| 0 |
| 0 |
| 1 |
+-------------------+