v0.6.0-rc.1

A small API. Familiar collections.

The public BsonLite API for version 0.6.0-rc.1.

Shared application instance

APIBehavior
connect(input?) / start(input?)Promise<Database>. Accepts no argument, a database-name string, or an options object. Reuses matching shared startup.
disconnect() / stop()Promise. Closes the shared connection and owned engine.
collection(name, options?)MongoDB Collection. Requires a completed shared connection.
ping()Promise. Issues a database ping through the shared instance.
status()Read-only status snapshot; no root credentials or data keys.
javascript
const { connected, state, name, host, port, directory } = BsonLite.status();

Independent handles

APIBehavior
open(options?)Promise<Database>. Accepts an options object; does not set the shared connection.
database.collection(name, options?)MongoDB Collection for this handle.
database.createCollection(name, options?)Promise<Collection>. Explicitly create a collection or supported view.
database.listCollections(filter?, options?)MongoDB cursor; materialize with toArray().
database.ping() / close()Ping or close this independent handle.
database.name / directory / info / closedRead-only handle state and bounded connection metadata.

There is no top-level create(), createCollection() or listCollections(). Use a returned Database handle for collection-management methods.

Connection options

OptionDefault / purpose
nameExisting supported metadata name, otherwise bsonlite. Use 1–63 bytes without spaces/reserved characters.
directory./Database from the working directory. Accepts a non-empty path or file URL.
silentfalse; suppresses shared startup status output when true.
maxPoolSize10; integer 1–1000.
cacheSizeGB0.25; WiredTiger cache setting, 0.25–64. This is not a total-process RAM limit.
startupTimeoutMS30000; integer 2000–180000.
shutdownTimeoutMS15000; integer 2000–60000.
storageEncryptionnative for new customer stores. Earlier policies are for administration/migration.

Unknown options are rejected. binaryPath and nativeManifest are developer engine-override options, not required for the embedded SDK. Windows uses DPAPI automatically and rejects vaultPassword; that option is for non-Windows source development.

Utilities and types

ExportPurpose
backup(options) / restore(options)Stopped-store encrypted backup and new-directory restoration.
migrate(options)Migrate supported non-native stores into a new native-encrypted directory.
recover({ directory }?)Synchronously remove only provably stale owned locks; refuses live/ambiguous ownership.
ObjectId / BSONDriver ObjectId and complete bundled BSON namespace.
BsonLiteErrorError class with code and message.
version / engineVersion / driverVersionSDK, server and driver version strings.

Documentation for BsonLite 0.6.0-rc.1. View SDK source · Download the validated SDK