sharedb-mingo-memory is an in-memory database adapter for ShareDB, providing a local, fast, and ephemeral data store that supports a subset of MongoDB's query API through the Mingo library. Its primary use cases include accelerating application testing by eliminating external database dependencies and facilitating local development environments. The current stable version is 4.1.0, with a release cadence tied to Node.js LTS versions and new major releases of ShareDB itself, ensuring broad compatibility. Key differentiators include its lightweight, in-memory nature, making it ideal for CI/CD pipelines and quick prototyping, while still offering a familiar MongoDB-like query interface. It integrates seamlessly with ShareDB applications for a mock database experience.
npm install sharedb-mingo-memoryVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize sharedb-mingo-memory, integrate it with ShareDB, create a document, and perform a basic query against the in-memory database.
Upgrade your Node.js runtime to version 18 or newer. For projects that cannot upgrade, sharedb-mingo-memory v3.x.x should be used.
Upgrade your Node.js runtime to version 16 or newer. For projects that cannot upgrade, sharedb-mingo-memory v2.x.x should be used.
Upgrade your Node.js runtime to version 14 or newer. For projects that cannot upgrade, sharedb-mingo-memory v1.x.x should be used.
Upgrade to sharedb-mingo-memory v2.1.0 or higher for basic `$aggregate` support. For `$lookup` within `$aggregate`, upgrade to v4.1.0 or higher. Consult the mingo documentation for supported aggregation pipeline stages.
Upgrade to sharedb-mingo-memory v3.0.1 or higher to remove the dependency on the `process` global, improving compatibility with bundlers and alternative JavaScript runtimes.
Refactor your query to avoid `$mapReduce` or consider using a different ShareDB database adapter that supports it (e.g., `sharedb-mongo`).
Ensure you are using the correct import syntax for your module system. For ESM, use `import ShareDBMingo from 'sharedb-mingo-memory';`. For CommonJS, use `const ShareDBMingo = require('sharedb-mingo-memory');`.Check the `peerDependencies` of `sharedb-mingo-memory` to ensure your `sharedb` version is compatible. Also, verify that your Node.js runtime meets the minimum version required by `sharedb-mingo-memory` (e.g., v4.x requires Node.js >=18).