const featureTypes = [
{
externalId: 'ocean_temperature',
properties: { temperature: { type: 'DOUBLE' as const }, location: { type: 'POINT' as const, srid: 4326 } } ,
searchSpec: { location_idx: { properties : ['location'] } }
}
];
const createdFeatureTypes = await client.geospatial.featureType.create(featureTypes);
await client.geospatial.featureType.delete([{ externalId: 'ocean_temperature'}], { recursive : true });
const allFeatureTypes = await client.geospatial.featureType.list();
const retrievedFeatureTypes = await client.geospatial.featureType.retrieve([ { externalId: 'ocean_temperature' } ]);
const featureTypesToUpdate = [
{
externalId: 'ocean_temperature',
update: {
properties: { add: { depth: { type: 'DOUBLE'} }, remove: ['temperature'] },
searchSpec: { add: { depth_idx: { properties: ['depth'] } } }
}
}
];
const updatedFeatureTypes = await client.geospatial.featureType.update(featureTypesToUpdate);
Deprecated
Asset-centric API, deprecated 2026-10-15 and retired 2027-12-31. Will be removed or moved in a future major release. See https://docs.cognite.com/cdf/deprecated and https://github.com/cognitedata/cognite-sdk-js/blob/master/guides/DEPRECATIONS.md.