title: Return values as array from collection
body: <p>We have a collection of scrips :</p>
  
  <pre><code>{
      "_id" : ObjectId("xxxxxxx"),
      "scrip" : "3647"
  }
  {
      "_id" : ObjectId("yyyyyy"),
      "scrip" : "5647"
  }
  ...
  </code></pre>
  
  <p>We are simply attempting to return the scrip numerals as an array of string using java driver 3.7</p>
  
  <pre><code>ArrayList&lt;Document&gt; scriplist = scrips.aggregate(Arrays.asList(
                  Aggregates.group(
                           Accumulators.push("scripids",
                                      new Document("_id", "$id").
                                              append("scripids", "$scripid"))
                  )
                  )).into(new ArrayList&lt;&gt;());
  
          System.out.println(scriplist.toString());
  </code></pre>
  
  <p>Expected output is <code>['3647','5647']</code>.</p>
  
  <p>However,we get a <code>'Can't find a codec for class com.mongodb.client.model.BsonField.'</code> exception.<br>
  How is this to be done?</p>