title: How to count json items in mysql
body: <p>I have table channels:</p>
  <pre><code>+----+----------------+---------+
  | id | sort           | bouquet |
  +----+----------------+---------+
  |  1 | [&quot;2&quot;,&quot;3&quot;,&quot;73&quot;] | [&quot;1&quot;]   |
  | 12 | [&quot;3&quot;,&quot;73&quot;]     | [&quot;28&quot;]  |
  +----+----------------+---------+
  </code></pre>
  <p>And need to get count items in sort field for specific boquet...for example:</p>
  <p>bouquet  1 have 3 sort items
  bouquet 12 have 2 sort items</p>
  <p>I try using this query in mysql but i did not get idea how can i calculate number of items in sort field:</p>
  <pre><code>SELECT COUNT(sort) AS total_channels 
  FROM channels 
  WHERE JSON_SEARCH(bouquet, 'one', &quot;1&quot;) IS NOT NULL;
  </code></pre>
  <p>I always get:</p>
  <pre><code>+----------------+
  | total_channels |
  +----------------+
  |              1 |
  +----------------+
  </code></pre>
  <p>Which is incorrect.</p>