
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
cache-mongodb
Advanced tools
$ npm install mongo-cache // with npm
$ yarn add mongo-cache // with yarn
$ pnpm add mongo-cache // with pnpm
// your-model.js
const { ModelWithCache } = require("mongo-cache");
const { Schema, model } = require("mongoose");
const yourSchema = new Schema({
name: String,
age: Number,
_id: String, // set id if you want to use it as cache key
});
const yourModel = model("YourModelName", yourSchema);
module.exports = new ModelWithCache(yourModel);
// idk.js
const model = require("../path/to/your-model");
async function maybeMain() {
// create document
const doc = await model.create({ name: "John", age: 20 });
// get all documents
const docs = await model.getAll(true); // true to skip cache
// get all documents with filter
const docs = await model.filter({ name: "John" }, true); // true to skip cache
// get document by id
const docById = await model.get(doc._id, true); // true to create if not exists
// get document by query
const docByQuery = await model.find({ name: "John" }, true); // true to create if not exists
// update document
const updatedDoc = await model.update(doc._id, { age: 21 });
/* or... */
doc.age = 21;
const updatedDoc = await model.update(doc._id, doc);
/* ❌ if you use <Document>.save(), the document won't be cached ❌ */
// delete document
await model.delete(doc._id);
// delete all documents
await model.deleteAll();
// delete all documents with filter
await model.deleteWithFilter({ name: "John" });
}
no se si tiene bugs xd
FAQs
Almacena en cache las bases de datos de MongoDB
We found that cache-mongodb demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.