As per documentation, mongoc_collection_aggregate() takes five arguments.
However, the example at http://mongoc.org/libmongoc/current/mongoc_collection_aggregate.html#example passes six arguments to the function:
cursor = mongoc_collection_aggregate (collection, MONGOC_QUERY_NONE, pipeline, NULL, NULL, NULL);