title: Couchbase - SELECT a subset of fields from array of objects
body: <p>I am using the <code>travel-sample</code> data set, and am running the following query:</p>
  
  <pre><code>SELECT id, schedule FROM `travel-sample`WHERE type = "route" LIMIT 1;
  </code></pre>
  
  <p>It is returning with the following results:</p>
  
  <pre><code>[
    {
      "id": 10000,
      "schedule": [
        {
          "day": 0,
          "flight": "AF198",
          "utc": "10:13:00"
        },
        {
          "day": 0,
          "flight": "AF547",
          "utc": "19:14:00"
        },
        ...
      ]
    }
  ]
  </code></pre>
  
  <p>However, I don't want to return the <code>schedule.$.day</code> field; i.e. I want my results to be:</p>
  
  <pre><code>[
    {
      "id": 10000,
      "schedule": [
        {
          "flight": "AF198",
          "utc": "10:13:00"
        },
        {
          "flight": "AF547",
          "utc": "19:14:00"
        },
        ...
      ]
    }
  ]
  </code></pre>
  
  <p>How can I <code>SELECT</code> only a subset of object fields from an array of objects?</p>
  
  <hr>
  
  <p>I have tried <code>UNNEST</code> but I don't want to have a separate record for each <code>schedule</code> element - I want the <code>schedule</code> elements to remain nested inside the document.</p>
  
  <p>I have also tried using <code>OBJECT_REMOVE</code></p>
  
  <pre><code>SELECT id, ARRAY OBJECT_REMOVE(x, 'day') FOR x in schedule END AS schedule FROM `travel-sample` WHERE type = "route" LIMIT 1;
  </code></pre>
  
  <p>But I want to whitelist rather than blacklist fields.</p>