A small API. Familiar collections.
The public BsonLite API for version 0.6.0-rc.1.
Independent handles
| API | Behavior |
|---|---|
| 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 / closed | Read-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
| Option | Default / purpose |
|---|---|
| name | Existing 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. |
| silent | false; suppresses shared startup status output when true. |
| maxPoolSize | 10; integer 1–1000. |
| cacheSizeGB | 0.25; WiredTiger cache setting, 0.25–64. This is not a total-process RAM limit. |
| startupTimeoutMS | 30000; integer 2000–180000. |
| shutdownTimeoutMS | 15000; integer 2000–60000. |
| storageEncryption | native 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
| Export | Purpose |
|---|---|
| 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 / BSON | Driver ObjectId and complete bundled BSON namespace. |
| BsonLiteError | Error class with code and message. |
| version / engineVersion / driverVersion | SDK, server and driver version strings. |
Documentation for BsonLite 0.6.0-rc.1. View SDK source · Download the validated SDK