title: How to search records using JSON function in mariadb from json array
body: <p>I am learning JSON function in mariaDB where I have</p>
  <pre><code>CREATE TABLE IF NOT EXISTS products ( 
                                       id     INT         NOT NULL PRIMARY KEY AUTO_INCREMENT, 
                                       type   VARCHAR(1)  NOT NULL, 
                                       name   VARCHAR(40) NOT NULL, 
                                       format VARCHAR(20) NOT NULL, 
                                       price  FLOAT(5, 2) NOT NULL, 
                                       attr   JSON NOT NULL
                                      ); 
  
  INSERT INTO products (type, name, format, price, attr) VALUES 
   ('M', 'Aliens', 'Blu-ray', 13.99,'{&quot;video&quot;: {&quot;resolution&quot;: &quot;1080p&quot;, &quot;aspectRatio&quot;: &quot;1.85:1&quot;}, &quot;cuts&quot;: [{&quot;name&quot;: &quot;Theatrical&quot;, &quot;runtime&quot;: 138}, {&quot;name&quot;:&quot;Special Edition&quot;, &quot;runtime&quot;: 155}], &quot;audio&quot;: [&quot;DTS HD&quot;, &quot;Dolby Surround&quot;]}'); 
  
  INSERT INTO products (type, name, format, price, attr) VALUES 
   ('B', 'Foundation', 'Paperback', 7.99, '{&quot;author&quot;: &quot;Isaac Asimov&quot;, &quot;page_count&quot;: 296}');
  </code></pre>
  <p>I want to find how many records are there where Cuts.name=&quot;Theatrical&quot;</p>
  <pre><code>SELECT * FROM `products` WHERE JSON_VALUE(attr,'$.cuts.name')='Theatrical'
  </code></pre>
  <p>I am getting 0 results here. How to search data from json array ?</p>