Skip to main content

Installation

Install via npm:
The package includes pre-built native bindings for all supported platforms. The correct binary is automatically loaded for your platform.

Quick start

TypeScript support

The package includes full TypeScript type definitions:

API reference

Database

Opening databases

Configuration

Database info

Transaction

Creating transactions

CRUD operations

1

Insert a document

2

Find by ID

3

Update the document

4

Commit the transaction

Transaction control

Always commit or rollback transactions. Unfinished transactions can lock database resources.

Collection management

Collection

For non-transactional operations with auto-commit:

Basic CRUD

Querying

Upsert operations

Bulk operations

Bulk write example:

Advanced operations

Query builder

Example:

Aggregation

Example:

Indexing

Schema validation

Example schema:

Change streams

Example:

Maintenance

Web UI

Example:

Complete example

Error handling

All operations throw errors on failure:

Platform support

Pre-built native bindings are provided for:
  • macOS (Intel and Apple Silicon)
  • Linux (x86_64, ARM64)
  • Windows (x86_64)
The package automatically loads the correct native binary for your platform. No additional build steps are required.