await client.instances.delete([
{
instanceType: "node",
externalId: "node-external-id",
space: "node-space",
},
]);
const response = await client.instances.list({
instanceType: 'node',
sources: [{
source: {
externalId: 'Describable',
space: 'cdf_core',
type: 'view',
version: 'v1',
},
}],
filter: {
equals: {
property: ['title'],
value: 'your title',
},
},
sort: [
{ property: ['title'], direction: 'ascending', nullsFirst: false },
],
limit: 1000,
});
const response = await client.instances.query({
with: {
result_set_1: {
nodes: {
filter: {
equals: {
property: ['node', 'externalId'],
value: "node-external-id",
},
},
},
},
},
select: {
result_set_1: {},
},
});
const response = await client.instances.retrieve({
sources: [{ source: {
externalId: 'Describable',
space: 'cdf_core',
type: 'view',
version: 'v1',
}
}],
items: [
{
externalId: "node-external-id",
space: "node-space",
instanceType: 'node',
},
],
});
const response = await client.instances.search({
view: {
externalId: 'Describable',
space: 'cdf_core',
type: 'view',
version: 'v1',
},
query: 'your_query',
filter: {
equals: {
property: ['title'],
value: 'your title',
},
},
limit: 1000,
});
const response = await client.instances.sync({
with: {
result_set_1: {
nodes: {
filter: {
equals: {
property: ['node', 'externalId'],
value: "node-external-id",
},
},
},
},
},
select: {
result_set_1: {},
},
});
await client.instances.upsert({
items: [
{
instanceType: 'node',
externalId: 'node-external-id',
space: 'node-space',
sources: [
{
source: {
externalId: 'Describable',
space: 'cdf_core',
type: 'view',
version: 'v1',
},
properties: {
title: 'node-title',
description: 'node-description',
labels: 'node-labels',
},
},
],
},
],
});
Aggregate instances
const response = await client.instances.aggregate({ view: { externalId: 'Describable', space: 'cdf_core', type: 'view', version: 'v1', }, groupBy: ['externalId'], aggregates: [{ count: { property: 'externalId' } }], filter: { prefix: { property: ['title'], value: 'titl', }, }, limit: 1, });