https://help.tago.io/portal/en/kb/articles/entities#Creating_an_Entity Creating an Entity
If receive an error "Authorization Denied", check policy Entity / Create in Access Management.
const result = await Resources.entities.create({
name: "Temperature Sensors",
schema: {
temperature: { action: "create", type: "float", required: true } }
});
console.log(result); // { id: 'entity-id-123' }
https://help.tago.io/portal/en/kb/articles/entities#Managing_fields Managing Fields
Delete data records in a entity using the profile token and entity ID.
See the example to understand how to use this method properly to have full control on what to delete.
https://help.tago.io/portal/en/kb/articles/entities#Managing_the_data_in_your_Entity Managing the data in your Entity
https://help.tago.io/portal/en/kb/articles/entities#Managing_fields Managing Fields
https://help.tago.io/portal/en/kb/articles/entities#Indexing_fields_to_improve_searching_and_sorting Indexing fields to improve searching and sorting
https://help.tago.io/portal/en/kb/articles/entities#Managing_fields Managing Fields
Updates existing data records in an entity.
The updatedData
can be a single data record or an array of records to be updated,
each of the records must have the id
of the record and the fields to be updated.
https://help.tago.io/portal/en/kb/articles/entities#Managing_the_data_in_your_Entity Managing the data in your Entity
https://help.tago.io/portal/en/kb/articles/entities#Indexing_fields_to_improve_searching_and_sorting Indexing fields to improve searching and sorting
If receive an error "Authorization Denied", check policy Entity / Edit in Access Management.
const result = await Resources.entities.editSchemaIndex("entity-id-123", {
schema: { unit: { action: "create", type: "float", required: false } },
index: { temp_idx: { action: "create", fields: ["temperature"] } }
});
console.log(result); // { message: 'Entity Successfully Updated' }
Removes all data records from an entity while preserving its structure and configuration.
https://help.tago.io/portal/en/kb/articles/entities#Managing_the_data_in_your_Entity Managing the data in your Entity
Optional
queryParams: EntityDataQueryOptional
options: { paramsSerializer?: any }https://help.tago.io/portal/en/kb/articles/entities#Managing_the_data_in_your_Entity Managing the data in your Entity
If receive an error "Authorization Denied", check policy Entity / Access in Access Management.
const result = await Resources.entities.getEntityData("entity-id-123", { amount: 10, orderBy: "created_at,desc" });
console.log(result); // [ { id: 'record-id-123', created_at: 2025-01-22T13:45:30.913Z, ... }, ... ]
// Filtering by a specific field
const result = await Resources.entities.getEntityData("entity-id-123", {
filter: { temperature: "30" },
index: "temp_idx",
amount: 9999,
});
console.log(result); // [ { id: 'record-id-123', created_at: 2025-01-22T13:45:30.913Z, ... }, ... ]
Optional
queryObj: EntityQueryOptional
options: { paramsSerializer?: any }https://help.tago.io/portal/en/kb/articles/entities#Managing_fields Managing Fields
Sends new data records to an entity.
The data
can be a single data record or an array of records to be sent.
https://help.tago.io/portal/en/kb/articles/entities#Managing_the_data_in_your_Entity Managing the data in your Entity
https://help.tago.io/portal/en/kb/articles/entities#Managing_fields Managing Fields
Description
Gets the total amount of data records stored in the entity.
See
https://help.tago.io/portal/en/kb/articles/entities Entities
Example
If receive an error "Authorization Denied", check policy Entity / Delete in Access Management.