Ir al contenido
v2.7

Databases

API antigua de bases de datos (colecciones y documentos). En un proyecto nuevo, usa TablesDB.

API antigua de bases de datos (colecciones y documentos). En un proyecto nuevo, usa TablesDB.

Clase Databases: 72 métodos (15 en @owbase/web, 72 en @owbase/node). Las descripciones de los métodos están en inglés. Los ejemplos usan la forma de objeto de los parámetros; cambia los valores entre < y > por los tuyos.

Listar bases de datos

GET /databases · página del método

SDK: solo @owbase/node

Get a list of all databases from the current Owbase project. You can use the search parameter to filter your results.

Parámetro Tipo Obligatorio Descripción
queries string[] no Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name
search string no Search term to filter your list results. Max length: 256 chars.
total boolean no When set to false, the total count returned will be 0 and will not be calculated.

Acceso: clave de API con el alcance databases.read.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.list({
queries: [], // optional
search: '<SEARCH>', // optional
total: false, // optional
});

Crear base de datos

POST /databases · página del método

SDK: solo @owbase/node

Create a new Database.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Unique Id. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can’t start with a special char. Max length is 36 chars.
name string sí Database name. Max length: 128 chars.
enabled boolean no Is the database enabled? When set to ‘disabled’, users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.
description string no Optional description for the database.

Acceso: clave de API con el alcance databases.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.create({
databaseId: '<DATABASE_ID>',
name: '<NAME>',
enabled: false, // optional
description: '<DESCRIPTION>', // optional
});

Listar transacciones

GET /databases/transactions · página del método

SDK: @owbase/web y @owbase/node

List transactions across all databases.

Parámetro Tipo Obligatorio Descripción
queries string[] no Array of query strings generated using the Query class provided by the SDK. Learn more about queries.
total boolean no When set to false, the total count returned will be 0 and will not be calculated.

Acceso: clave de API con el alcance documents.read (también acepta rows.read) o sesión del usuario, o incluso sin sesión (vale lo que permitan los permisos del recurso).

@owbase/web
import { Client, Databases } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const databases = new Databases(client);
const result = await databases.listTransactions({
queries: [], // optional
total: false, // optional
});
console.log(result);
@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.listTransactions({
queries: [], // optional
total: false, // optional
});

Crear transacción

POST /databases/transactions · página del método

SDK: @owbase/web y @owbase/node

Create a new transaction.

Parámetro Tipo Obligatorio Descripción
ttl number no Seconds before the transaction expires.

Acceso: clave de API con el alcance documents.write o sesión del usuario, o incluso sin sesión (vale lo que permitan los permisos del recurso).

@owbase/web
import { Client, Databases } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const databases = new Databases(client);
const result = await databases.createTransaction({
ttl: 60, // optional
});
console.log(result);
@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.createTransaction({
ttl: 60, // optional
});

Obtener transacción

GET /databases/transactions/{transactionId} · página del método

SDK: @owbase/web y @owbase/node

Get a transaction by its unique ID.

Parámetro Tipo Obligatorio Descripción
transactionId string sí Transaction ID.

Acceso: clave de API con el alcance documents.read (también acepta rows.read) o sesión del usuario, o incluso sin sesión (vale lo que permitan los permisos del recurso).

@owbase/web
import { Client, Databases } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const databases = new Databases(client);
const result = await databases.getTransaction({
transactionId: '<TRANSACTION_ID>',
});
console.log(result);
@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.getTransaction({
transactionId: '<TRANSACTION_ID>',
});

Actualizar transacción

PATCH /databases/transactions/{transactionId} · página del método

SDK: @owbase/web y @owbase/node

Update a transaction, to either commit or roll back its operations.

Parámetro Tipo Obligatorio Descripción
transactionId string sí Transaction ID.
commit boolean no Commit transaction?
rollback boolean no Rollback transaction?

Acceso: clave de API con el alcance documents.write o sesión del usuario, o incluso sin sesión (vale lo que permitan los permisos del recurso).

@owbase/web
import { Client, Databases } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const databases = new Databases(client);
const result = await databases.updateTransaction({
transactionId: '<TRANSACTION_ID>',
commit: false, // optional
rollback: false, // optional
});
console.log(result);
@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.updateTransaction({
transactionId: '<TRANSACTION_ID>',
commit: false, // optional
rollback: false, // optional
});

Eliminar transacción

DELETE /databases/transactions/{transactionId} · página del método

SDK: @owbase/web y @owbase/node

Delete a transaction by its unique ID.

Parámetro Tipo Obligatorio Descripción
transactionId string sí Transaction ID.

Acceso: clave de API con el alcance documents.write o sesión del usuario, o incluso sin sesión (vale lo que permitan los permisos del recurso).

@owbase/web
import { Client, Databases } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const databases = new Databases(client);
const result = await databases.deleteTransaction({
transactionId: '<TRANSACTION_ID>',
});
console.log(result);
@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.deleteTransaction({
transactionId: '<TRANSACTION_ID>',
});

Crear operaciones

POST /databases/transactions/{transactionId}/operations · página del método

SDK: @owbase/web y @owbase/node

Create multiple operations in a single transaction.

Parámetro Tipo Obligatorio Descripción
transactionId string sí Transaction ID.
operations object[] no Array of staged operations.

Acceso: clave de API con el alcance documents.write o sesión del usuario, o incluso sin sesión (vale lo que permitan los permisos del recurso).

@owbase/web
import { Client, Databases } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const databases = new Databases(client);
const result = await databases.createOperations({
transactionId: '<TRANSACTION_ID>',
operations: [
{
action: 'create',
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
data: {
name: "Walter O'Brien",
},
},
], // optional
});
console.log(result);
@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.createOperations({
transactionId: '<TRANSACTION_ID>',
operations: [
{
action: 'create',
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
data: {
name: "Walter O'Brien",
},
},
], // optional
});

Obtener base de datos

GET /databases/{databaseId} · página del método

SDK: solo @owbase/node

Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.

Acceso: clave de API con el alcance databases.read.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.get({
databaseId: '<DATABASE_ID>',
});

Actualizar base de datos

PUT /databases/{databaseId} · página del método

SDK: solo @owbase/node

Update a database by its unique ID.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
name string no Database name. Max length: 128 chars.
enabled boolean no Is database enabled? When set to ‘disabled’, users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.
description string no Optional description for the database.

Acceso: clave de API con el alcance databases.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.update({
databaseId: '<DATABASE_ID>',
name: '<NAME>', // optional
enabled: false, // optional
description: '<DESCRIPTION>', // optional
});

Eliminar base de datos

DELETE /databases/{databaseId} · página del método

SDK: solo @owbase/node

Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.

Acceso: clave de API con el alcance databases.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.delete({
databaseId: '<DATABASE_ID>',
});

Listar colecciones

GET /databases/{databaseId}/collections · página del método

SDK: solo @owbase/node

Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
queries string[] no Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity
search string no Search term to filter your list results. Max length: 256 chars.
total boolean no When set to false, the total count returned will be 0 and will not be calculated.

Acceso: clave de API con el alcance collections.read.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.listCollections({
databaseId: '<DATABASE_ID>',
queries: [], // optional
search: '<SEARCH>', // optional
total: false, // optional
});

Crear colecciones

POST /databases/{databaseId}/collections · página del método

SDK: solo @owbase/node

Create a new Collection. Before using this route, you should create a new database resource using either a server integration API or directly from your database console.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Unique Id. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can’t start with a special char. Max length is 36 chars.
name string sí Collection name. Max length: 128 chars.
permissions string[] no An array of permissions strings. By default, no user is granted with any permissions. Learn more about permissions.
documentSecurity boolean no Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. Learn more about permissions.
enabled boolean no Is collection enabled? When set to ‘disabled’, users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.
attributes object[] no Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, varchar, text, mediumtext, longtext, integer, bigint, double, boolean, datetime, point, linestring, polygon, email, url, ip, enum), size (integer, required for string and varchar types), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.
indexes object[] no Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial, trigram), attributes (array of attribute keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional).
description string no Optional description for the collection.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases, Permission, Role } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.createCollection({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
name: '<NAME>',
permissions: [Permission.read(Role.any())], // optional
documentSecurity: false, // optional
enabled: false, // optional
attributes: [], // optional
indexes: [], // optional
description: '<DESCRIPTION>', // optional
});

Obtener colección

GET /databases/{databaseId}/collections/{collectionId} · página del método

SDK: solo @owbase/node

Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID.

Acceso: clave de API con el alcance collections.read.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.getCollection({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
});

Actualizar colección

PUT /databases/{databaseId}/collections/{collectionId} · página del método

SDK: solo @owbase/node

Update a collection by its unique ID.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID.
name string no Collection name. Max length: 128 chars.
permissions string[] no An array of permission strings. By default, the current permissions are inherited. Learn more about permissions.
documentSecurity boolean no Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. Learn more about permissions.
enabled boolean no Is collection enabled? When set to ‘disabled’, users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.
purge boolean no When true, purge all cached list responses for this collection as part of the update. Use this to force readers to see fresh data immediately instead of waiting for the cache TTL to expire.
description string no Optional description for the collection.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases, Permission, Role } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.updateCollection({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
name: '<NAME>', // optional
permissions: [Permission.read(Role.any())], // optional
documentSecurity: false, // optional
enabled: false, // optional
purge: false, // optional
description: '<DESCRIPTION>', // optional
});

Eliminar colección

DELETE /databases/{databaseId}/collections/{collectionId} · página del método

SDK: solo @owbase/node

Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.deleteCollection({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
});

Listar atributos

GET /databases/{databaseId}/collections/{collectionId}/attributes · página del método

SDK: solo @owbase/node

List attributes in the collection.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID.
queries string[] no Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, size, required, array, status, error
total boolean no When set to false, the total count returned will be 0 and will not be calculated.

Acceso: clave de API con el alcance collections.read.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.listAttributes({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
queries: [], // optional
total: false, // optional
});

Crear atributo bigint

POST /databases/{databaseId}/collections/{collectionId}/attributes/bigint · página del método

SDK: solo @owbase/node

Create a bigint attribute. Optionally, minimum and maximum values can be provided.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID.
key string sí Attribute Key.
required boolean sí Is attribute required?
min number no Minimum value
max number no Maximum value
xdefault number no Default value. Cannot be set when attribute is required.
array boolean no Is attribute an array?
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.createBigIntAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
required: false,
min: 0, // optional
max: 1000000, // optional
xdefault: 0, // optional
array: false, // optional
description: '<DESCRIPTION>', // optional
});

Actualizar atributo bigint

PATCH /databases/{databaseId}/collections/{collectionId}/attributes/bigint/{key} · página del método

SDK: solo @owbase/node

Update a bigint attribute. Changing the default value will not update already existing documents.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID.
key string sí Attribute Key.
required boolean sí Is attribute required?
xdefault number no Default value. Cannot be set when attribute is required.
min number no Minimum value
max number no Maximum value
newKey string no New Attribute Key.
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.updateBigIntAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
required: false,
xdefault: 0,
min: 0, // optional
max: 1000000, // optional
newKey: '<NEW_KEY>', // optional
description: '<DESCRIPTION>', // optional
});

Crear atributo booleano

POST /databases/{databaseId}/collections/{collectionId}/attributes/boolean · página del método

SDK: solo @owbase/node

Create a boolean attribute.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID. You can create a new collection using the Database service server integration.
key string sí Attribute Key.
required boolean sí Is attribute required?
xdefault boolean no Default value for attribute when not provided. Cannot be set when attribute is required.
array boolean no Is attribute an array?
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.createBooleanAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
required: false,
xdefault: false, // optional
array: false, // optional
description: '<DESCRIPTION>', // optional
});

Actualizar atributo booleano

PATCH /databases/{databaseId}/collections/{collectionId}/attributes/boolean/{key} · página del método

SDK: solo @owbase/node

Update a boolean attribute. Changing the default value will not update already existing documents.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID. You can create a new collection using the Database service server integration.
key string sí Attribute Key.
required boolean sí Is attribute required?
xdefault boolean no Default value for attribute when not provided. Cannot be set when attribute is required.
newKey string no New attribute key.
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.updateBooleanAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
required: false,
xdefault: false,
newKey: '<NEW_KEY>', // optional
description: '<DESCRIPTION>', // optional
});

Crear atributo de fecha y hora

POST /databases/{databaseId}/collections/{collectionId}/attributes/datetime · página del método

SDK: solo @owbase/node

Create a date time attribute according to the ISO 8601 standard.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID. You can create a new collection using the Database service server integration.
key string sí Attribute Key.
required boolean sí Is attribute required?
xdefault string no Default value for the attribute in ISO 8601 format. Cannot be set when attribute is required.
array boolean no Is attribute an array?
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.createDatetimeAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
required: false,
xdefault: '2020-10-15T06:38:00.000+00:00', // optional
array: false, // optional
description: '<DESCRIPTION>', // optional
});

Actualizar atributo de fecha y hora

PATCH /databases/{databaseId}/collections/{collectionId}/attributes/datetime/{key} · página del método

SDK: solo @owbase/node

Update a date time attribute. Changing the default value will not update already existing documents.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID.
key string sí Attribute Key.
required boolean sí Is attribute required?
xdefault string no Default value for attribute when not provided. Cannot be set when attribute is required.
newKey string no New attribute key.
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.updateDatetimeAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
required: false,
xdefault: '2020-10-15T06:38:00.000+00:00',
newKey: '<NEW_KEY>', // optional
description: '<DESCRIPTION>', // optional
});

Crear atributo de correo

POST /databases/{databaseId}/collections/{collectionId}/attributes/email · página del método

SDK: solo @owbase/node

Create an email attribute.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID.
key string sí Attribute Key.
required boolean sí Is attribute required?
xdefault string no Default value for attribute when not provided. Cannot be set when attribute is required.
array boolean no Is attribute an array?
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.createEmailAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
required: false,
xdefault: '[email protected]', // optional
array: false, // optional
description: '<DESCRIPTION>', // optional
});

Actualizar atributo de correo

PATCH /databases/{databaseId}/collections/{collectionId}/attributes/email/{key} · página del método

SDK: solo @owbase/node

Update an email attribute. Changing the default value will not update already existing documents.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID.
key string sí Attribute Key.
required boolean sí Is attribute required?
xdefault string no Default value for attribute when not provided. Cannot be set when attribute is required.
newKey string no New Attribute Key.
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.updateEmailAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
required: false,
xdefault: '[email protected]',
newKey: '<NEW_KEY>', // optional
description: '<DESCRIPTION>', // optional
});

Crear atributo enum

POST /databases/{databaseId}/collections/{collectionId}/attributes/enum · página del método

SDK: solo @owbase/node

Create an enum attribute. The elements param acts as a white-list of accepted values for this attribute.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID.
key string sí Attribute Key.
elements string[] sí Array of enum values.
required boolean sí Is attribute required?
xdefault string no Default value for attribute when not provided. Cannot be set when attribute is required.
array boolean no Is attribute an array?
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.createEnumAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
elements: ['active', 'inactive'],
required: false,
xdefault: 'active', // optional
array: false, // optional
description: '<DESCRIPTION>', // optional
});

Actualizar atributo enum

PATCH /databases/{databaseId}/collections/{collectionId}/attributes/enum/{key} · página del método

SDK: solo @owbase/node

Update an enum attribute. Changing the default value will not update already existing documents.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID.
key string sí Attribute Key.
elements string[] sí Updated list of enum values.
required boolean sí Is attribute required?
xdefault string no Default value for attribute when not provided. Cannot be set when attribute is required.
newKey string no New Attribute Key.
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.updateEnumAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
elements: ['active', 'inactive'],
required: false,
xdefault: 'active',
newKey: '<NEW_KEY>', // optional
description: '<DESCRIPTION>', // optional
});

Crear atributo float

POST /databases/{databaseId}/collections/{collectionId}/attributes/float · página del método

SDK: solo @owbase/node

Create a float attribute. Optionally, minimum and maximum values can be provided.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID.
key string sí Attribute Key.
required boolean sí Is attribute required?
min number no Minimum value.
max number no Maximum value.
xdefault number no Default value. Cannot be set when required.
array boolean no Is attribute an array?
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.createFloatAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
required: false,
min: 0, // optional
max: 100, // optional
xdefault: 10.5, // optional
array: false, // optional
description: '<DESCRIPTION>', // optional
});

Actualizar atributo float

PATCH /databases/{databaseId}/collections/{collectionId}/attributes/float/{key} · página del método

SDK: solo @owbase/node

Update a float attribute. Changing the default value will not update already existing documents.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID.
key string sí Attribute Key.
required boolean sí Is attribute required?
xdefault number no Default value. Cannot be set when required.
min number no Minimum value.
max number no Maximum value.
newKey string no New Attribute Key.
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.updateFloatAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
required: false,
xdefault: 10.5,
min: 0, // optional
max: 100, // optional
newKey: '<NEW_KEY>', // optional
description: '<DESCRIPTION>', // optional
});

Crear atributo entero

POST /databases/{databaseId}/collections/{collectionId}/attributes/integer · página del método

SDK: solo @owbase/node

Create an integer attribute. Optionally, minimum and maximum values can be provided.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID.
key string sí Attribute Key.
required boolean sí Is attribute required?
min number no Minimum value
max number no Maximum value
xdefault number no Default value. Cannot be set when attribute is required.
array boolean no Is attribute an array?
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.createIntegerAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
required: false,
min: 0, // optional
max: 100, // optional
xdefault: 10, // optional
array: false, // optional
description: '<DESCRIPTION>', // optional
});

Actualizar atributo entero

PATCH /databases/{databaseId}/collections/{collectionId}/attributes/integer/{key} · página del método

SDK: solo @owbase/node

Update an integer attribute. Changing the default value will not update already existing documents.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID.
key string sí Attribute Key.
required boolean sí Is attribute required?
xdefault number no Default value. Cannot be set when attribute is required.
min number no Minimum value
max number no Maximum value
newKey string no New Attribute Key.
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.updateIntegerAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
required: false,
xdefault: 10,
min: 0, // optional
max: 100, // optional
newKey: '<NEW_KEY>', // optional
description: '<DESCRIPTION>', // optional
});

Crear atributo IP

POST /databases/{databaseId}/collections/{collectionId}/attributes/ip · página del método

SDK: solo @owbase/node

Create IP address attribute.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID.
key string sí Attribute Key.
required boolean sí Is attribute required?
xdefault string no Default value. Cannot be set when attribute is required.
array boolean no Is attribute an array?
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.createIpAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
required: false,
xdefault: '192.0.2.0', // optional
array: false, // optional
description: '<DESCRIPTION>', // optional
});

Actualizar atributo IP

PATCH /databases/{databaseId}/collections/{collectionId}/attributes/ip/{key} · página del método

SDK: solo @owbase/node

Update an ip attribute. Changing the default value will not update already existing documents.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID.
key string sí Attribute Key.
required boolean sí Is attribute required?
xdefault string no Default value. Cannot be set when attribute is required.
newKey string no New Attribute Key.
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.updateIpAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
required: false,
xdefault: '192.0.2.0',
newKey: '<NEW_KEY>', // optional
description: '<DESCRIPTION>', // optional
});

Crear atributo de línea

POST /databases/{databaseId}/collections/{collectionId}/attributes/line · página del método

SDK: solo @owbase/node

Create a geometric line attribute.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID. You can create a new collection using the Database service server integration.
key string sí Attribute Key.
required boolean sí Is attribute required?
xdefault number[][] no Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.createLineAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
required: false,
xdefault: [
[1, 2],
[3, 4],
[5, 6],
], // optional
description: '<DESCRIPTION>', // optional
});

Actualizar atributo de línea

PATCH /databases/{databaseId}/collections/{collectionId}/attributes/line/{key} · página del método

SDK: solo @owbase/node

Update a line attribute. Changing the default value will not update already existing documents.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID. You can create a new collection using the Database service server integration.
key string sí Attribute Key.
required boolean sí Is attribute required?
xdefault number[][] no Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.
newKey string no New attribute key.
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.updateLineAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
required: false,
xdefault: [
[1, 2],
[3, 4],
[5, 6],
], // optional
newKey: '<NEW_KEY>', // optional
description: '<DESCRIPTION>', // optional
});

Crear atributo longtext

POST /databases/{databaseId}/collections/{collectionId}/attributes/longtext · página del método

SDK: solo @owbase/node

Create a longtext attribute.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID. You can create a new collection using the Database service server integration.
key string sí Attribute Key.
required boolean sí Is attribute required?
xdefault string no Default value for attribute when not provided. Cannot be set when attribute is required.
array boolean no Is attribute an array?
encrypt boolean no Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.createLongtextAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
required: false,
xdefault: 'Hello World', // optional
array: false, // optional
encrypt: false, // optional
description: '<DESCRIPTION>', // optional
});

Actualizar atributo longtext

PATCH /databases/{databaseId}/collections/{collectionId}/attributes/longtext/{key} · página del método

SDK: solo @owbase/node

Update a longtext attribute. Changing the default value will not update already existing documents.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID. You can create a new collection using the Database service server integration.
key string sí Attribute Key.
required boolean sí Is attribute required?
xdefault string no Default value for attribute when not provided. Cannot be set when attribute is required.
newKey string no New Attribute Key.
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.updateLongtextAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
required: false,
xdefault: 'Hello World',
newKey: '<NEW_KEY>', // optional
description: '<DESCRIPTION>', // optional
});

Crear atributo mediumtext

POST /databases/{databaseId}/collections/{collectionId}/attributes/mediumtext · página del método

SDK: solo @owbase/node

Create a mediumtext attribute.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID. You can create a new collection using the Database service server integration.
key string sí Attribute Key.
required boolean sí Is attribute required?
xdefault string no Default value for attribute when not provided. Cannot be set when attribute is required.
array boolean no Is attribute an array?
encrypt boolean no Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.createMediumtextAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
required: false,
xdefault: 'Hello World', // optional
array: false, // optional
encrypt: false, // optional
description: '<DESCRIPTION>', // optional
});

Actualizar atributo mediumtext

PATCH /databases/{databaseId}/collections/{collectionId}/attributes/mediumtext/{key} · página del método

SDK: solo @owbase/node

Update a mediumtext attribute. Changing the default value will not update already existing documents.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID. You can create a new collection using the Database service server integration.
key string sí Attribute Key.
required boolean sí Is attribute required?
xdefault string no Default value for attribute when not provided. Cannot be set when attribute is required.
newKey string no New Attribute Key.
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.updateMediumtextAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
required: false,
xdefault: 'Hello World',
newKey: '<NEW_KEY>', // optional
description: '<DESCRIPTION>', // optional
});

Crear atributo de punto

POST /databases/{databaseId}/collections/{collectionId}/attributes/point · página del método

SDK: solo @owbase/node

Create a geometric point attribute.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID. You can create a new collection using the Database service server integration.
key string sí Attribute Key.
required boolean sí Is attribute required?
xdefault number[] no Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.createPointAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
required: false,
xdefault: [1, 2], // optional
description: '<DESCRIPTION>', // optional
});

Actualizar atributo de punto

PATCH /databases/{databaseId}/collections/{collectionId}/attributes/point/{key} · página del método

SDK: solo @owbase/node

Update a point attribute. Changing the default value will not update already existing documents.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID. You can create a new collection using the Database service server integration.
key string sí Attribute Key.
required boolean sí Is attribute required?
xdefault number[] no Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.
newKey string no New attribute key.
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.updatePointAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
required: false,
xdefault: [1, 2], // optional
newKey: '<NEW_KEY>', // optional
description: '<DESCRIPTION>', // optional
});

Crear atributo de polígono

POST /databases/{databaseId}/collections/{collectionId}/attributes/polygon · página del método

SDK: solo @owbase/node

Create a geometric polygon attribute.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID. You can create a new collection using the Database service server integration.
key string sí Attribute Key.
required boolean sí Is attribute required?
xdefault number[][][] no Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.createPolygonAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
required: false,
xdefault: [
[
[1, 2],
[3, 4],
[5, 6],
[1, 2],
],
], // optional
description: '<DESCRIPTION>', // optional
});

Actualizar atributo de polígono

PATCH /databases/{databaseId}/collections/{collectionId}/attributes/polygon/{key} · página del método

SDK: solo @owbase/node

Update a polygon attribute. Changing the default value will not update already existing documents.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID. You can create a new collection using the Database service server integration.
key string sí Attribute Key.
required boolean sí Is attribute required?
xdefault number[][][] no Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.
newKey string no New attribute key.
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.updatePolygonAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
required: false,
xdefault: [
[
[1, 2],
[3, 4],
[5, 6],
[1, 2],
],
], // optional
newKey: '<NEW_KEY>', // optional
description: '<DESCRIPTION>', // optional
});

Crear atributo de relación

POST /databases/{databaseId}/collections/{collectionId}/attributes/relationship · página del método

SDK: solo @owbase/node

Create relationship attribute. Learn more about relationship attributes.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID.
relatedCollectionId string sí Related Collection ID.
type RelationshipType sí Relationship type. Possible values are: oneToOne, oneToMany, manyToOne, manyToMany. Valores: oneToOne, manyToOne, manyToMany, oneToMany.
twoWay boolean no Is Two Way?
key string no Attribute Key.
twoWayKey string no Two Way Attribute Key.
onDelete RelationMutate no Delete constraint. Possible values are: cascade, restrict, setNull. Valores: cascade, restrict, setNull.
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases, RelationshipType, RelationMutate } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.createRelationshipAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
relatedCollectionId: '<RELATED_COLLECTION_ID>',
type: RelationshipType.OneToOne,
twoWay: false, // optional
key: '<KEY>', // optional
twoWayKey: '<TWO_WAY_KEY>', // optional
onDelete: RelationMutate.Cascade, // optional
description: '<DESCRIPTION>', // optional
});

Actualizar atributo de relación

PATCH /databases/{databaseId}/collections/{collectionId}/attributes/relationship/{key} · página del método

SDK: solo @owbase/node

Update relationship attribute. Learn more about relationship attributes.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID.
key string sí Attribute Key.
onDelete RelationMutate no Delete constraint. Possible values are: cascade, restrict, setNull. Valores: cascade, restrict, setNull.
newKey string no New Attribute Key.
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases, RelationMutate } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.updateRelationshipAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
onDelete: RelationMutate.Cascade, // optional
newKey: '<NEW_KEY>', // optional
description: '<DESCRIPTION>', // optional
});

Crear atributo string

POST /databases/{databaseId}/collections/{collectionId}/attributes/string · página del método

SDK: solo @owbase/node

Create a string attribute.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID. You can create a new table using the Database service server integration.
key string sí Attribute Key.
size number sí Attribute size for text attributes, in number of characters.
required boolean sí Is attribute required?
xdefault string no Default value for attribute when not provided. Cannot be set when attribute is required.
array boolean no Is attribute an array?
encrypt boolean no Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.createStringAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
size: 1,
required: false,
xdefault: 'Hello World', // optional
array: false, // optional
encrypt: false, // optional
description: '<DESCRIPTION>', // optional
});

Actualizar atributo string

PATCH /databases/{databaseId}/collections/{collectionId}/attributes/string/{key} · página del método

SDK: solo @owbase/node

Update a string attribute. Changing the default value will not update already existing documents.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID. You can create a new table using the Database service server integration.
key string sí Attribute Key.
required boolean sí Is attribute required?
xdefault string no Default value for attribute when not provided. Cannot be set when attribute is required.
size number no Maximum size of the string attribute.
newKey string no New Attribute Key.
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.updateStringAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
required: false,
xdefault: 'Hello World',
size: 1, // optional
newKey: '<NEW_KEY>', // optional
description: '<DESCRIPTION>', // optional
});

Crear atributo de texto

POST /databases/{databaseId}/collections/{collectionId}/attributes/text · página del método

SDK: solo @owbase/node

Create a text attribute.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID. You can create a new collection using the Database service server integration.
key string sí Attribute Key.
required boolean sí Is attribute required?
xdefault string no Default value for attribute when not provided. Cannot be set when attribute is required.
array boolean no Is attribute an array?
encrypt boolean no Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.createTextAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
required: false,
xdefault: 'Hello World', // optional
array: false, // optional
encrypt: false, // optional
description: '<DESCRIPTION>', // optional
});

Actualizar atributo de texto

PATCH /databases/{databaseId}/collections/{collectionId}/attributes/text/{key} · página del método

SDK: solo @owbase/node

Update a text attribute. Changing the default value will not update already existing documents.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID. You can create a new collection using the Database service server integration.
key string sí Attribute Key.
required boolean sí Is attribute required?
xdefault string no Default value for attribute when not provided. Cannot be set when attribute is required.
newKey string no New Attribute Key.
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.updateTextAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
required: false,
xdefault: 'Hello World',
newKey: '<NEW_KEY>', // optional
description: '<DESCRIPTION>', // optional
});

Crear atributo URL

POST /databases/{databaseId}/collections/{collectionId}/attributes/url · página del método

SDK: solo @owbase/node

Create a URL attribute.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID.
key string sí Attribute Key.
required boolean sí Is attribute required?
xdefault string no Default value for attribute when not provided. Cannot be set when attribute is required.
array boolean no Is attribute an array?
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.createUrlAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
required: false,
xdefault: 'https://example.com', // optional
array: false, // optional
description: '<DESCRIPTION>', // optional
});

Actualizar atributo URL

PATCH /databases/{databaseId}/collections/{collectionId}/attributes/url/{key} · página del método

SDK: solo @owbase/node

Update an url attribute. Changing the default value will not update already existing documents.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID.
key string sí Attribute Key.
required boolean sí Is attribute required?
xdefault string no Default value for attribute when not provided. Cannot be set when attribute is required.
newKey string no New Attribute Key.
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.updateUrlAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
required: false,
xdefault: 'https://example.com',
newKey: '<NEW_KEY>', // optional
description: '<DESCRIPTION>', // optional
});

Crear atributo varchar

POST /databases/{databaseId}/collections/{collectionId}/attributes/varchar · página del método

SDK: solo @owbase/node

Create a varchar attribute.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID. You can create a new collection using the Database service server integration.
key string sí Attribute Key.
size number sí Attribute size for varchar attributes, in number of characters. Maximum size is 16381.
required boolean sí Is attribute required?
xdefault string no Default value for attribute when not provided. Cannot be set when attribute is required.
array boolean no Is attribute an array?
encrypt boolean no Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.createVarcharAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
size: 1,
required: false,
xdefault: 'Hello World', // optional
array: false, // optional
encrypt: false, // optional
description: '<DESCRIPTION>', // optional
});

Actualizar atributo varchar

PATCH /databases/{databaseId}/collections/{collectionId}/attributes/varchar/{key} · página del método

SDK: solo @owbase/node

Update a varchar attribute. Changing the default value will not update already existing documents.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID. You can create a new collection using the Database service server integration.
key string sí Attribute Key.
required boolean sí Is attribute required?
xdefault string no Default value for attribute when not provided. Cannot be set when attribute is required.
size number no Maximum size of the varchar attribute.
newKey string no New Attribute Key.
description string no Optional description for the attribute.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.updateVarcharAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
required: false,
xdefault: 'Hello World',
size: 1, // optional
newKey: '<NEW_KEY>', // optional
description: '<DESCRIPTION>', // optional
});

Obtener atributo

GET /databases/{databaseId}/collections/{collectionId}/attributes/{key} · página del método

SDK: solo @owbase/node

Get attribute by ID.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID.
key string sí Attribute Key.

Acceso: clave de API con el alcance collections.read.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.getAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
});

Eliminar atributo

DELETE /databases/{databaseId}/collections/{collectionId}/attributes/{key} · página del método

SDK: solo @owbase/node

Deletes an attribute.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID.
key string sí Attribute Key.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.deleteAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
});

Listar documentos

GET /databases/{databaseId}/collections/{collectionId}/documents · página del método

SDK: @owbase/web y @owbase/node

Get a list of all the user’s documents in a given collection. You can use the query params to filter your results.

Documents returned by aggregate, groupBy or distinct queries hold only the attributes they select, group or aggregate, typed as a document types them, with a joined attribute named by its join alias (alias.attribute). The response omits their $id, $sequence, $createdAt, $updatedAt, $permissions, $databaseId and $collectionId unless they select or group it, and those of a right or full join document that no document of this collection matched. SDK document models fill omitted system attributes with empty values.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID. You can create a new collection using the Database service server integration.
queries string[] no Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long.
transactionId string no Transaction ID to read uncommitted changes within the transaction.
total boolean no When set to false, the total count returned will be 0 and will not be calculated.
ttl number no TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Lists with join queries are not cached. Must be between 0 and 86400 (24 hours).

Acceso: clave de API con el alcance documents.read o sesión del usuario, o incluso sin sesión (vale lo que permitan los permisos del recurso).

@owbase/web
import { Client, Databases } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const databases = new Databases(client);
const result = await databases.listDocuments({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
queries: [], // optional
transactionId: '<TRANSACTION_ID>', // optional
total: false, // optional
ttl: 0, // optional
});
console.log(result);
@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
const databases = new Databases(client);
const result = await databases.listDocuments({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
queries: [], // optional
transactionId: '<TRANSACTION_ID>', // optional
total: false, // optional
ttl: 0, // optional
});

Crear documento

POST /databases/{databaseId}/collections/{collectionId}/documents · página del método

SDK: @owbase/web y @owbase/node

Create a new Document. Before using this route, you should create a new collection resource using either a server integration API or directly from your database console.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID. You can create a new collection using the Database service server integration. Make sure to define attributes before creating documents.
documentId string sí Document ID. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can’t start with a special char. Max length is 36 chars.
data object sí Document data as JSON object.
permissions string[] no An array of permissions strings. By default, only the current user is granted all permissions. Learn more about permissions.
transactionId string no Transaction ID for staging the operation.

Acceso: clave de API con el alcance documents.write o sesión del usuario, o incluso sin sesión (vale lo que permitan los permisos del recurso).

@owbase/web
import { Client, Databases, Permission, Role } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const databases = new Databases(client);
const result = await databases.createDocument({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
data: {
username: 'walter.obrien',
fullName: "Walter O'Brien",
age: 30,
isAdmin: false,
},
permissions: [Permission.read(Role.any())], // optional
transactionId: '<TRANSACTION_ID>', // optional
});
console.log(result);
@owbase/node
import { Client, Databases, Permission, Role } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
const databases = new Databases(client);
const result = await databases.createDocument({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
data: {
username: 'walter.obrien',
fullName: "Walter O'Brien",
age: 30,
isAdmin: false,
},
permissions: [Permission.read(Role.any())], // optional
transactionId: '<TRANSACTION_ID>', // optional
});

Crear documentos

POST /databases/{databaseId}/collections/{collectionId}/documents · página del método

SDK: solo @owbase/node

Create new Documents. Before using this route, you should create a new collection resource using either a server integration API or directly from your database console.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID. You can create a new collection using the Database service server integration. Make sure to define attributes before creating documents.
documents object[] sí Array of documents data as JSON objects.
transactionId string no Transaction ID for staging the operation.

Acceso: clave de API con el alcance documents.write o sesión del usuario, o incluso sin sesión (vale lo que permitan los permisos del recurso).

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.createDocuments({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documents: [
{
$id: 'example1',
username: 'walter.obrien',
fullName: "Walter O'Brien",
age: 30,
isAdmin: false,
},
],
transactionId: '<TRANSACTION_ID>', // optional
});

Crear o actualizar documentos

PUT /databases/{databaseId}/collections/{collectionId}/documents · página del método

SDK: solo @owbase/node

Create or update Documents. Before using this route, you should create a new collection resource using either a server integration API or directly from your database console.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID.
documents object[] sí Array of document data as JSON objects. May contain partial documents.
transactionId string no Transaction ID for staging the operation.

Acceso: clave de API con el alcance documents.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.upsertDocuments({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documents: [
{
$id: 'example1',
username: 'walter.obrien',
fullName: "Walter O'Brien",
age: 30,
isAdmin: false,
},
],
transactionId: '<TRANSACTION_ID>', // optional
});

Actualizar documentos

PATCH /databases/{databaseId}/collections/{collectionId}/documents · página del método

SDK: solo @owbase/node

Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID.
data object no Document data as JSON object. Include only attribute and value pairs to be updated.
queries string[] no Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long.
transactionId string no Transaction ID for staging the operation.

Acceso: clave de API con el alcance documents.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.updateDocuments({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
data: {
username: 'walter.obrien',
fullName: "Walter O'Brien",
age: 33,
isAdmin: false,
}, // optional
queries: [], // optional
transactionId: '<TRANSACTION_ID>', // optional
});

Eliminar documentos

DELETE /databases/{databaseId}/collections/{collectionId}/documents · página del método

SDK: solo @owbase/node

Bulk delete documents using queries, if no queries are passed then all documents are deleted.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID. You can create a new collection using the Database service server integration.
queries string[] no Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long.
transactionId string no Transaction ID for staging the operation.

Acceso: clave de API con el alcance documents.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.deleteDocuments({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
queries: [
'{"method":"equal", "attribute":"$id", "values":["<DOCUMENT_ID>"]}',
], // optional
transactionId: '<TRANSACTION_ID>', // optional
});

Crear consulta

POST /databases/{databaseId}/collections/{collectionId}/documents/query · página del método

SDK: @owbase/web y @owbase/node

Get a list of all the user’s documents in a given collection using a POST request. This behaves identically to the list documents endpoint but accepts the queries in the request body, allowing much larger queries arrays than can fit in a URL query string.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID. You can create a new collection using the Database service server integration.
queries string[] no Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long.
transactionId string no Transaction ID to read uncommitted changes within the transaction.
total boolean no When set to false, the total count returned will be 0 and will not be calculated.
ttl number no TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Lists with join queries are not cached. Must be between 0 and 86400 (24 hours).

Acceso: clave de API con el alcance documents.read o sesión del usuario, o incluso sin sesión (vale lo que permitan los permisos del recurso).

@owbase/web
import { Client, Databases } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const databases = new Databases(client);
const result = await databases.createQuery({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
queries: [], // optional
transactionId: '<TRANSACTION_ID>', // optional
total: false, // optional
ttl: 0, // optional
});
console.log(result);
@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
const databases = new Databases(client);
const result = await databases.createQuery({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
queries: [], // optional
transactionId: '<TRANSACTION_ID>', // optional
total: false, // optional
ttl: 0, // optional
});

Obtener documento

GET /databases/{databaseId}/collections/{collectionId}/documents/{documentId} · página del método

SDK: @owbase/web y @owbase/node

Get a document by its unique ID. This endpoint response returns a JSON object with the document data.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID. You can create a new collection using the Database service server integration.
documentId string sí Document ID.
queries string[] no Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long.
transactionId string no Transaction ID to read uncommitted changes within the transaction.

Acceso: clave de API con el alcance documents.read o sesión del usuario, o incluso sin sesión (vale lo que permitan los permisos del recurso).

@owbase/web
import { Client, Databases } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const databases = new Databases(client);
const result = await databases.getDocument({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
queries: [], // optional
transactionId: '<TRANSACTION_ID>', // optional
});
console.log(result);
@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
const databases = new Databases(client);
const result = await databases.getDocument({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
queries: [], // optional
transactionId: '<TRANSACTION_ID>', // optional
});

Crear o actualizar un documento

PUT /databases/{databaseId}/collections/{collectionId}/documents/{documentId} · página del método

SDK: @owbase/web y @owbase/node

Create or update a Document. Before using this route, you should create a new collection resource using either a server integration API or directly from your database console.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID.
documentId string sí Document ID.
data object no Document data as JSON object. Include all required attributes of the document to be created or updated.
permissions string[] no An array of permissions strings. By default, the current permissions are inherited. Learn more about permissions.
transactionId string no Transaction ID for staging the operation.

Acceso: clave de API con el alcance documents.write o sesión del usuario, o incluso sin sesión (vale lo que permitan los permisos del recurso).

@owbase/web
import { Client, Databases, Permission, Role } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const databases = new Databases(client);
const result = await databases.upsertDocument({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
data: {
username: 'walter.obrien',
fullName: "Walter O'Brien",
age: 30,
isAdmin: false,
}, // optional
permissions: [Permission.read(Role.any())], // optional
transactionId: '<TRANSACTION_ID>', // optional
});
console.log(result);
@owbase/node
import { Client, Databases, Permission, Role } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
const databases = new Databases(client);
const result = await databases.upsertDocument({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
data: {
username: 'walter.obrien',
fullName: "Walter O'Brien",
age: 30,
isAdmin: false,
}, // optional
permissions: [Permission.read(Role.any())], // optional
transactionId: '<TRANSACTION_ID>', // optional
});

Actualizar documento

PATCH /databases/{databaseId}/collections/{collectionId}/documents/{documentId} · página del método

SDK: @owbase/web y @owbase/node

Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID.
documentId string sí Document ID.
data object no Document data as JSON object. Include only attribute and value pairs to be updated.
permissions string[] no An array of permissions strings. By default, the current permissions are inherited. Learn more about permissions.
transactionId string no Transaction ID for staging the operation.

Acceso: clave de API con el alcance documents.write o sesión del usuario, o incluso sin sesión (vale lo que permitan los permisos del recurso).

@owbase/web
import { Client, Databases, Permission, Role } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const databases = new Databases(client);
const result = await databases.updateDocument({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
data: {
username: 'walter.obrien',
fullName: "Walter O'Brien",
age: 33,
isAdmin: false,
}, // optional
permissions: [Permission.read(Role.any())], // optional
transactionId: '<TRANSACTION_ID>', // optional
});
console.log(result);
@owbase/node
import { Client, Databases, Permission, Role } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
const databases = new Databases(client);
const result = await databases.updateDocument({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
data: {
username: 'walter.obrien',
fullName: "Walter O'Brien",
age: 33,
isAdmin: false,
}, // optional
permissions: [Permission.read(Role.any())], // optional
transactionId: '<TRANSACTION_ID>', // optional
});

Eliminar documento

DELETE /databases/{databaseId}/collections/{collectionId}/documents/{documentId} · página del método

SDK: @owbase/web y @owbase/node

Delete a document by its unique ID.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID. You can create a new collection using the Database service server integration.
documentId string sí Document ID.
transactionId string no Transaction ID for staging the operation.

Acceso: clave de API con el alcance documents.write o sesión del usuario, o incluso sin sesión (vale lo que permitan los permisos del recurso).

@owbase/web
import { Client, Databases } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const databases = new Databases(client);
const result = await databases.deleteDocument({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
transactionId: '<TRANSACTION_ID>', // optional
});
console.log(result);
@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
const databases = new Databases(client);
const result = await databases.deleteDocument({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
transactionId: '<TRANSACTION_ID>', // optional
});

Decrementar atributo del documento

PATCH /databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement · página del método

SDK: @owbase/web y @owbase/node

Decrement a specific attribute of a document by a given value.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID.
documentId string sí Document ID.
attribute string sí Attribute key.
value number no Value to increment the attribute by. The value must be a number.
min number no Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.
transactionId string no Transaction ID for staging the operation.

Acceso: clave de API con el alcance documents.write o sesión del usuario, o incluso sin sesión (vale lo que permitan los permisos del recurso).

@owbase/web
import { Client, Databases } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const databases = new Databases(client);
const result = await databases.decrementDocumentAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
attribute: '<ATTRIBUTE>',
value: 1, // optional
min: 0, // optional
transactionId: '<TRANSACTION_ID>', // optional
});
console.log(result);
@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
const databases = new Databases(client);
const result = await databases.decrementDocumentAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
attribute: '<ATTRIBUTE>',
value: 1, // optional
min: 0, // optional
transactionId: '<TRANSACTION_ID>', // optional
});

Incrementar atributo del documento

PATCH /databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment · página del método

SDK: @owbase/web y @owbase/node

Increment a specific attribute of a document by a given value.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID.
documentId string sí Document ID.
attribute string sí Attribute key.
value number no Value to increment the attribute by. The value must be a number.
max number no Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.
transactionId string no Transaction ID for staging the operation.

Acceso: clave de API con el alcance documents.write o sesión del usuario, o incluso sin sesión (vale lo que permitan los permisos del recurso).

@owbase/web
import { Client, Databases } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const databases = new Databases(client);
const result = await databases.incrementDocumentAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
attribute: '<ATTRIBUTE>',
value: 1, // optional
max: 100, // optional
transactionId: '<TRANSACTION_ID>', // optional
});
console.log(result);
@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
const databases = new Databases(client);
const result = await databases.incrementDocumentAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
attribute: '<ATTRIBUTE>',
value: 1, // optional
max: 100, // optional
transactionId: '<TRANSACTION_ID>', // optional
});

Listar índices

GET /databases/{databaseId}/collections/{collectionId}/indexes · página del método

SDK: solo @owbase/node

List indexes in the collection.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID. You can create a new collection using the Database service server integration.
queries string[] no Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error
total boolean no When set to false, the total count returned will be 0 and will not be calculated.

Acceso: clave de API con el alcance collections.read.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.listIndexes({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
queries: [], // optional
total: false, // optional
});

Crear índice

POST /databases/{databaseId}/collections/{collectionId}/indexes · página del método

SDK: solo @owbase/node

Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. Attributes can be key, fulltext, unique, spatial, and trigram. trigram is only available on PostgreSQL and lets contains, startsWith, and endsWith queries on string attributes use an index.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID. You can create a new collection using the Database service server integration.
key string sí Index Key.
type DatabasesIndexType sí Index type. Valores: key, fulltext, unique, spatial, trigram.
attributes string[] sí Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.
orders OrderBy[] no Array of index orders. Maximum of 100 orders are allowed. Valores: asc, desc.
lengths number[] no Length of index. Maximum of 100
description string no Optional description for the index.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases, DatabasesIndexType, OrderBy } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.createIndex({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
type: DatabasesIndexType.Key,
attributes: ['username'],
orders: [OrderBy.Asc], // optional
lengths: [], // optional
description: '<DESCRIPTION>', // optional
});

Obtener índice

GET /databases/{databaseId}/collections/{collectionId}/indexes/{key} · página del método

SDK: solo @owbase/node

Get an index by its unique ID.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID. You can create a new collection using the Database service server integration.
key string sí Index Key.

Acceso: clave de API con el alcance collections.read.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.getIndex({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
});

Eliminar índice

DELETE /databases/{databaseId}/collections/{collectionId}/indexes/{key} · página del método

SDK: solo @owbase/node

Delete an index.

Parámetro Tipo Obligatorio Descripción
databaseId string sí Database ID.
collectionId string sí Collection ID. You can create a new collection using the Database service server integration.
key string sí Index Key.

Acceso: clave de API con el alcance collections.write.

@owbase/node
import { Client, Databases } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const databases = new Databases(client);
const result = await databases.deleteIndex({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '<KEY>',
});

Las descripciones de esta página vienen de la especificación de la API del servidor (licencia BSD-3-Clause), en inglés, y los ejemplos vienen del generador de SDKs (licencia MIT). Los avisos completos están en el archivo NOTICE de los paquetes @owbase/web y @owbase/node.

¿Te ayudó esta página?