For the complete documentation index, see llms.txt. This page is also available as Markdown.

Database

Store your app's data in MongoDB collections that follow a schema you design, and get a ready API for every collection.

The Database module stores your app's data — orders, products, bookings — in MongoDB collections. You describe each collection once with a schema; Norbix then checks every write against it, builds the record form in Cloud, and serves a create, read, update, delete and query API for the collection. The data lives in MongoDB: your own cluster, or a managed Atlas Flex cluster that Norbix runs for you.

Enable the module

Open a project and choose Database in the left menu. While the module is off, Cloud shows this page; press ENABLE. You need a project role that can manage modules (for example Administrator).

The Norbix Database enable page: Instant database with: Norbix Database, three benefits (Launch your backend in minutes, Store any kind of data, Keep your data safe and yours), an ENABLE button and a Learn more link
Database → enable page, shown while the module is off.

After ENABLE, Cloud opens Database → Collections. A new project already has one database integration, Primary Database, so you can create a collection at once. To turn the module off again, see Settings — no data is deleted.

Data Collections list right after ENABLE, with the Database menu on the left: Collections, Taxonomies, Aggregates, Integrations, Settings
After ENABLE: the Collections screen and the Database menu.

Module map

Screen
What it is for

The schema contract for hand-written and AI-written schemas: the field types with every keyword and refusal, references, nested forms and arrays.

Lists of terms (categories, tags, places) that records can point at, in a tree when needed.

Saved MongoDB aggregation pipelines that your app runs by id.

The MongoDB databases your project stores its collections in.

Turn the module off for the project.

Your first collection

  1. Check the integration — a new project has Primary Database as the default; connect your own MongoDB if you want the data in your cluster.

  2. Create a schema — for example authors with a name, a country and a year of birth; press Save & publish.

  3. Add a record — open the collection and press Add New.

  4. Read it from code — find with the SDK, or norbix api database find with the CLI.

Use it from code

Every Do it from code block in the Database pages uses this client. Install @norbix.ai/ts (see SDK install) and set NORBIX_API_KEY to a project API key.

The CLI lines use the generic norbix hub … and norbix api … commands of @norbix.ai/cli (signed in with norbix login, project id in NORBIX_PROJECT_ID):

The client sends the project id with every call (the norbix-project-id header), so the requests do not repeat it. The CLI does the same with the project of norbix login --project …, norbix config set projectId … or NORBIX_PROJECT_ID. The short commands work too, for example norbix db find books and norbix db count books.

  • The Hub (norbix.hub.database, norbix hub database …) manages the module: schemas, taxonomies, triggers, aggregates and integrations. It can also read and write records.

  • The API (norbix.api.database, norbix api database …) is what your app calls: records, terms and saved aggregates. It also accepts a signed-in end user's token.

  • Every record call can name a databaseIntegrationId; without it the default integration of the request's environment is used.

Integrations concept · Triggers concept · SDK · CLI · API · What agents can do

Last updated

Was this helpful?