title: MySQL conditional filter element from json array
body: <p>Have a json array type column in MySQL, and trying to conditionally filter out some elements form the array. Here is the example:</p>
  
  <blockquote>
    <h2>Original json array</h2>
    
    <p>[
     {"name": "Atencion a Clientes", "number": "*111"},
     {"name": "Atn Ciudadana", "number": "066"}, 
     {"name": "Atn Ctes Intl", "number": "+525525813300"}, 
     {"name": "Bomberos", "number": "116"},
     {"name": "Chelo", "number": "993-120-2100"}
     ]</p>
  </blockquote>
  
  <p>The desired output is like this:</p>
  
  <blockquote>
    <h2>Desired output json array</h2>
    
    <p>[
     {"name": "Atn Ctes Intl", "number": "+525525813300"}, 
     {"name": "Chelo", "number": "993-120-2100"}
     ]</p>
  </blockquote>
  
  <p>We want only keep the the elements with phone number length >= 10. Tried using the following code, which does NOT work. Is that possible to achieve this through MySQL functions ?  Thanks a lot. </p>
  
  <blockquote>
    <p>WHERE  length(replace(json_extract(phone_contacts,'$[*].number'  ) , ' ', '') ) >= 10</p>
  </blockquote>