I would like to dissolve a polygon/featurecollection in GEE to run some statistics by the country level. I have tried union and dissolve and cannot find a solution. Union dissolves everything to get the boundary of all polygons. How can I dissolve by a property in GEE? It would be similar to dissolve by attribute in ArcMap/QGIS.
//Purpose: Dissolve featurecollection by a property
//Name WDPA variable
var WDPA = ee.FeatureCollection("WCMC/WDPA/current/polygons");
print(WDPA.first(), 'WDPA'); //28 properties
Map.addLayer(WDPA, {}, 'WDPA'); //adds featurecollection to map
//Union using the property
var WDPA_union = table.union('ISO3'); //ERROR: Invalid argument specified for ee.Number(): ISO3
print(WDPA_union.first(), 'WDPA Union by ISO');
Map.addLayer(WDPA_union, {}, 'WDPA Union by ISO');
//Dissolve using the property
var WDPA_dissolve = WDPA_ISO.dissolve('ISO3'); //ERROR: Cannot read property 'dissolve' of undefined
print(WDPA_dissolve.first(), 'WDPA Dissolve by ISO');
Map.addLayer(WDPA_dissolve, {}, 'WDPA Dissolve by ISO');