//MONGOC_VERSION_S "0.92.3" ./configure --with-libbson=bundled
const bson_t *doc;
bson_iter_t iter;
bson_iter_t iter2;
uint32_t length;
mongoc_client_get_collection mongoc_collection_find mongoc_cursor_next
and then
bson_iter_init(&iter,doc);
bson_iter_find_descendant(&iter,"X.0.Y",&iter2); // for first
bson_iter_find_descendant(&iter,"X.1.Z",&iter2); // for second array element
printf("%d\n",bson_iter_type(&iter2));
for type 2
printf("%s\n",bson_iter_utf8(&iter2,&length));