Skip to content

Latest commit

 

History

History
543 lines (363 loc) · 15.4 KB

database.md

File metadata and controls

543 lines (363 loc) · 15.4 KB

API · Database

← Back to API index · ↑ Back to project README

Database schemas, integrations, triggers, taxonomies, and module on/off switches. For data-level CRUD on collections see api.database.

Accessed as norbix.api.database on the Norbix client.

Endpoints

Method Verb Path Scope
findMergedTermTree GET /{version}/database/taxonomies/{taxonomyName}/merged-tree project
findTaxonomyTree GET /{version}/database/taxonomies/tree project
findTerms GET /{version}/database/taxonomies/{taxonomyName}/terms project
findTermsChildren GET /{version}/database/taxonomies/{taxonomyName}/terms/{parentId}/children project
findTermTree GET /{version}/database/taxonomies/{taxonomyName}/terms/tree project
getDatabaseSchema GET /{version}/database/schemas/{id} project
getDatabaseSchemas GET /{version}/database/schemas project
aggregate POST /{version}/database/collections/{collectionName}/aggregate project
changeResponsibility PUT /{version}/database/collections/{collectionName}/{id}/responsibility project
count GET /{version}/database/collections/{collectionName}/count project
deleteMany DELETE /{version}/database/collections/{collectionName}/many project
deleteOne DELETE /{version}/database/collections/{collectionName}/{id} project
distinct GET /{version}/database/collections/{collectionName}/distinct project
executeAggregate POST /{version}/database/collections/{collectionName}/aggregates/{aggregateId}/execute project
find GET /{version}/database/collections/{collectionName} project
findOne GET /{version}/database/collections/{collectionName}/{id} project
findOwn GET /{version}/database/collections/{collectionName}/own project
insertMany POST /{version}/database/collections/{collectionName}/many project
insertOne POST /{version}/database/collections/{collectionName} project
replaceOne PUT /{version}/database/collections/{collectionName}/{id}/replace project
updateMany PUT /{version}/database/collections/{collectionName}/many project
updateOne PUT /{version}/database/collections/{collectionName}/{id} project

Reference

findMergedTermTree

GET /{version}/database/taxonomies/{taxonomyName}/merged-tree

Search / paginate items.

Request DTO: CodeMashApi2.FindMergedTermTreeRequest Response: CodeMashApi2.FindMergedTermTreeResponse

import { Norbix } from '@norbix.ai/ts';

const norbix = new Norbix();

const result = await norbix.api.database.findMergedTermTree({
  taxonomyName: 'taxonomyName-here',
  // Other fields: see CodeMash type for the full request shape.
});
// → typed as CodeMashApi2.FindMergedTermTreeResponse

↑ Top

findTaxonomyTree

GET /{version}/database/taxonomies/tree

Search / paginate items.

Request DTO: CodeMashApi2.FindTaxonomyTreeRequest Response: CodeMashApi2.FindTaxonomyTreeResponse

import { Norbix } from '@norbix.ai/ts';

const norbix = new Norbix();

const result = await norbix.api.database.findTaxonomyTree({
  // See CodeMash type for the full request shape.
});
// → typed as CodeMashApi2.FindTaxonomyTreeResponse

↑ Top

findTerms

GET /{version}/database/taxonomies/{taxonomyName}/terms

Search / paginate items.

Request DTO: CodeMashApi2.FindTermsRequest Response: CodeMashApi2.FindTermsResponse

import { Norbix } from '@norbix.ai/ts';

const norbix = new Norbix();

const result = await norbix.api.database.findTerms({
  taxonomyName: 'taxonomyName-here',
  // Other fields: see CodeMash type for the full request shape.
});
// → typed as CodeMashApi2.FindTermsResponse

↑ Top

findTermsChildren

GET /{version}/database/taxonomies/{taxonomyName}/terms/{parentId}/children

Search / paginate items.

Request DTO: CodeMashApi2.FindTermsChildrenRequest Response: CodeMashApi2.FindTermsChildrenResponse

import { Norbix } from '@norbix.ai/ts';

const norbix = new Norbix();

const result = await norbix.api.database.findTermsChildren({
  taxonomyName: 'taxonomyName-here',
  parentId: 'parentId-here',
  // Other fields: see CodeMash type for the full request shape.
});
// → typed as CodeMashApi2.FindTermsChildrenResponse

↑ Top

findTermTree

GET /{version}/database/taxonomies/{taxonomyName}/terms/tree

Search / paginate items.

Request DTO: CodeMashApi2.FindTermTreeRequest Response: CodeMashApi2.FindTermTreeResponse

import { Norbix } from '@norbix.ai/ts';

const norbix = new Norbix();

const result = await norbix.api.database.findTermTree({
  taxonomyName: 'taxonomyName-here',
  // Other fields: see CodeMash type for the full request shape.
});
// → typed as CodeMashApi2.FindTermTreeResponse

↑ Top

getDatabaseSchema

GET /{version}/database/schemas/{id}

Fetch a single item by ID.

Request DTO: CodeMashApi2.GetDatabaseSchemaRequest Response: CodeMashApi2.GetDatabaseSchemaResponse

import { Norbix } from '@norbix.ai/ts';

const norbix = new Norbix();

const result = await norbix.api.database.getDatabaseSchema({
  id: 'id-here',
  // Other fields: see CodeMash type for the full request shape.
});
// → typed as CodeMashApi2.GetDatabaseSchemaResponse

↑ Top

getDatabaseSchemas

GET /{version}/database/schemas

Fetch a single item by ID.

Request DTO: CodeMashApi2.GetDatabaseSchemasRequest Response: CodeMashApi2.GetDatabaseSchemasResponse

import { Norbix } from '@norbix.ai/ts';

const norbix = new Norbix();

const result = await norbix.api.database.getDatabaseSchemas({
  // See CodeMash type for the full request shape.
});
// → typed as CodeMashApi2.GetDatabaseSchemasResponse

↑ Top

aggregate

POST /{version}/database/collections/{collectionName}/aggregate

Run an aggregation pipeline.

Request DTO: CodeMashApi2.AggregateRequest Response: CodeMashApi2.AggregateResponse

import { Norbix } from '@norbix.ai/ts';

const norbix = new Norbix();

const result = await norbix.api.database.aggregate({
  collectionName: 'collectionName-here',
  // Other fields: see CodeMash type for the full request shape.
});
// → typed as CodeMashApi2.AggregateResponse

↑ Top

changeResponsibility

PUT /{version}/database/collections/{collectionName}/{id}/responsibility

Request DTO: CodeMashApi2.ChangeResponsibilityRequest Response: CodeMashApi2.EmptyResponse

import { Norbix } from '@norbix.ai/ts';

const norbix = new Norbix();

const result = await norbix.api.database.changeResponsibility({
  collectionName: 'collectionName-here',
  id: 'id-here',
  // Other fields: see CodeMash type for the full request shape.
});
// → typed as CodeMashApi2.EmptyResponse

↑ Top

count

GET /{version}/database/collections/{collectionName}/count

Count items matching the filter.

Request DTO: CodeMashApi2.CountRequest Response: CodeMashApi2.CountResponse

import { Norbix } from '@norbix.ai/ts';

const norbix = new Norbix();

const result = await norbix.api.database.count({
  collectionName: 'collectionName-here',
  // Other fields: see CodeMash type for the full request shape.
});
// → typed as CodeMashApi2.CountResponse

↑ Top

deleteMany

DELETE /{version}/database/collections/{collectionName}/many

Delete an item.

Request DTO: CodeMashApi2.DeleteManyRequest Response: CodeMashApi2.EmptyResponse

import { Norbix } from '@norbix.ai/ts';

const norbix = new Norbix();

const result = await norbix.api.database.deleteMany({
  collectionName: 'collectionName-here',
  // Other fields: see CodeMash type for the full request shape.
});
// → typed as CodeMashApi2.EmptyResponse

↑ Top

deleteOne

DELETE /{version}/database/collections/{collectionName}/{id}

Delete an item.

Request DTO: CodeMashApi2.DeleteOneRequest Response: CodeMashApi2.EmptyResponse

import { Norbix } from '@norbix.ai/ts';

const norbix = new Norbix();

const result = await norbix.api.database.deleteOne({
  collectionName: 'collectionName-here',
  id: 'id-here',
  // Other fields: see CodeMash type for the full request shape.
});
// → typed as CodeMashApi2.EmptyResponse

↑ Top

distinct

GET /{version}/database/collections/{collectionName}/distinct

Return distinct values for a field.

Request DTO: CodeMashApi2.DistinctRequest Response: CodeMashApi2.DistinctResponse

import { Norbix } from '@norbix.ai/ts';

const norbix = new Norbix();

const result = await norbix.api.database.distinct({
  collectionName: 'collectionName-here',
  // Other fields: see CodeMash type for the full request shape.
});
// → typed as CodeMashApi2.DistinctResponse

↑ Top

executeAggregate

POST /{version}/database/collections/{collectionName}/aggregates/{aggregateId}/execute

Request DTO: CodeMashApi2.ExecuteAggregateRequest Response: CodeMashApi2.ExecuteAggregateResponse

import { Norbix } from '@norbix.ai/ts';

const norbix = new Norbix();

const result = await norbix.api.database.executeAggregate({
  collectionName: 'collectionName-here',
  aggregateId: 'aggregateId-here',
  // Other fields: see CodeMash type for the full request shape.
});
// → typed as CodeMashApi2.ExecuteAggregateResponse

↑ Top

find

GET /{version}/database/collections/{collectionName}

Search / paginate items.

Request DTO: CodeMashApi2.FindRequest Response: CodeMashApi2.FindResponse

import { Norbix } from '@norbix.ai/ts';

const norbix = new Norbix();

const result = await norbix.api.database.find({
  collectionName: 'collectionName-here',
  // Other fields: see CodeMash type for the full request shape.
});
// → typed as CodeMashApi2.FindResponse

↑ Top

findOne

GET /{version}/database/collections/{collectionName}/{id}

Search / paginate items.

Request DTO: CodeMashApi2.FindOneRequest Response: CodeMashApi2.FindOneResponse

import { Norbix } from '@norbix.ai/ts';

const norbix = new Norbix();

const result = await norbix.api.database.findOne({
  collectionName: 'collectionName-here',
  id: 'id-here',
  // Other fields: see CodeMash type for the full request shape.
});
// → typed as CodeMashApi2.FindOneResponse

↑ Top

findOwn

GET /{version}/database/collections/{collectionName}/own

Search / paginate items.

Request DTO: CodeMashApi2.FindOwnRequest Response: CodeMashApi2.FindResponse

import { Norbix } from '@norbix.ai/ts';

const norbix = new Norbix();

const result = await norbix.api.database.findOwn({
  collectionName: 'collectionName-here',
  // Other fields: see CodeMash type for the full request shape.
});
// → typed as CodeMashApi2.FindResponse

↑ Top

insertMany

POST /{version}/database/collections/{collectionName}/many

Insert one or more items.

Request DTO: CodeMashApi2.InsertManyRequest Response: CodeMashApi2.EmptyResponse

import { Norbix } from '@norbix.ai/ts';

const norbix = new Norbix();

const result = await norbix.api.database.insertMany({
  collectionName: 'collectionName-here',
  // Other fields: see CodeMash type for the full request shape.
});
// → typed as CodeMashApi2.EmptyResponse

↑ Top

insertOne

POST /{version}/database/collections/{collectionName}

Insert one or more items.

Request DTO: CodeMashApi2.InsertOneRequest Response: CodeMashApi2.IdResponse

import { Norbix } from '@norbix.ai/ts';

const norbix = new Norbix();

const result = await norbix.api.database.insertOne({
  collectionName: 'collectionName-here',
  // Other fields: see CodeMash type for the full request shape.
});
// → typed as CodeMashApi2.IdResponse

↑ Top

replaceOne

PUT /{version}/database/collections/{collectionName}/{id}/replace

Replace an existing item wholesale.

Request DTO: CodeMashApi2.ReplaceOneRequest Response: CodeMashApi2.EmptyResponse

import { Norbix } from '@norbix.ai/ts';

const norbix = new Norbix();

const result = await norbix.api.database.replaceOne({
  collectionName: 'collectionName-here',
  id: 'id-here',
  // Other fields: see CodeMash type for the full request shape.
});
// → typed as CodeMashApi2.EmptyResponse

↑ Top

updateMany

PUT /{version}/database/collections/{collectionName}/many

Update an existing item.

Request DTO: CodeMashApi2.UpdateManyRequest Response: CodeMashApi2.EmptyResponse

import { Norbix } from '@norbix.ai/ts';

const norbix = new Norbix();

const result = await norbix.api.database.updateMany({
  collectionName: 'collectionName-here',
  // Other fields: see CodeMash type for the full request shape.
});
// → typed as CodeMashApi2.EmptyResponse

↑ Top

updateOne

PUT /{version}/database/collections/{collectionName}/{id}

Update an existing item.

Request DTO: CodeMashApi2.UpdateOneRequest Response: CodeMashApi2.EmptyResponse

import { Norbix } from '@norbix.ai/ts';

const norbix = new Norbix();

const result = await norbix.api.database.updateOne({
  collectionName: 'collectionName-here',
  id: 'id-here',
  // Other fields: see CodeMash type for the full request shape.
});
// → typed as CodeMashApi2.EmptyResponse

↑ Top