A lightweight, promise-based in-memory database with MongoDB-like query syntax (e.g., $in, $gte, $lte) for Node.js. Version 1.3.3 (last release appears infrequent, no clear cadence) provides basic CRUD operations, sorting, skipping, and field projection. Unlike full databases, it stores data in memory without persistence, making it suitable for caching or prototyping. No external dependencies.
npm install cache-databaseNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to require the default export, create a collection, insert a document, and query with a MongoDB-style operator.
Access result.data for the documents array.
Pass sort as the third argument, e.g., find(query, projection, sort, skip, limit) – but the README shows sort as third or fourth; check documentation.
Use .then() or await inside async functions.
Use const cache = require('cache-database');Ensure you await the promise: const result = await collection.find(...);
No dependency data recorded yet.