message: Don't run complex aggregation examples on mongo < 3.6
diff: // See the License for the specific language governing permissions and
  // limitations under the License.
  +#include <iostream>
  #include <list>
  #include <numeric>
  +#include <sstream>
  #include <vector>
  #include <bsoncxx/builder/basic/array.hpp>
  #include <bsoncxx/builder/basic/document.hpp>
  -#include <iostream>
  +#include <bsoncxx/string/to_string.hpp>
  #include <mongocxx/client.hpp>
  #include <mongocxx/exception/exception.hpp>
  #include <mongocxx/exception/logic_error.hpp>
  using namespace mongocxx;
  -void aggregation_examples(const mongocxx::database& db) {
  +std::string get_server_version(const client& client) {
  + bsoncxx::builder::basic::document server_status{};
  + server_status.append(bsoncxx::builder::basic::kvp("serverStatus", 1));
  + bsoncxx::document::value output = client["test"].run_command(server_status.extract());
  +
  + return bsoncxx::string::to_string(output.view()["version"].get_utf8().value);
  +}
  +
  +void aggregation_examples(const mongocxx::client& client, const mongocxx::database& db) {
  {
  // Start Aggregation Example 1
  using namespace bsoncxx::builder::basic;
  @@ -134,12 +144,16 @@ void aggregation_examples(const mongocxx::database& db) {
  auto cursor = db["air_alliances"].aggregate(p, mongocxx::options::aggregate{});
  // End Aggregation Example 4
  + // Bit of a hack for now since CI tooling runs an older version of mongo
  + // than this example requires.
  + if (get_server_version(client) >= "3.6" ) {
  auto count = std::distance(cursor.begin(), cursor.end());
  if (count != 0L) {
  throw std::logic_error("wrong count in example 4");
  }
  }
  }
  +}
  int main() {
  // The mongocxx::instance constructor and destructor initialize and shut down the driver,
  @@ -151,7 +165,7 @@ int main() {
  auto const db = conn["documentation_examples"];
  try {
  - aggregation_examples(db);
  + aggregation_examples(conn, db);
  } catch (const std::logic_error& e) {
  std::cerr << e.what() << std::endl;
  return EXIT_FAILURE;
  