title: Wordpress pods: Exporting specific columns to json
body: <p>I have the following code for exporting all the items in one of my pods to json. The thing is I don't need all the 130 columns in the json file, but only about 20. Since this will be done for about 150 items I thought I could save some loading time by not printing out all the fields, but I do not know how to do this. For example I only want to print the column value named 'title' for all items in the pod. My code is attached bellow. </p>
  
  <pre><code>&lt;?php
  $pods = pods('name', array('orderby' =&gt; 'name asc', 'limit' =&gt; -1));
  $all_companies = $pods-&gt;export_data();
  if ( !empty( $all_companies ) ) {
      die(json_encode($all_companies);
  }else{
      die(json_encode(array('error' =&gt; 'No cars found.')));
  } 
  ?&gt;
  </code></pre>
  
  <p>I thought about doing something like this:</p>
  
  <pre><code>if ( 0 &lt; $all_companies-&gt;total() ) {
      while ($all_companies-&gt;fetch()) {
          $json .= $all_companies-&gt;field('title');
      }
      $json = rtrim($json, ",");
      $json .= '}}';
  }
  echo $json;
  </code></pre>
  
  <p>But it doesn't work and also the code becomes very long.</p>