
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
mongoose-schema-registry
Advanced tools
Creates a schema registry that can be used to store and retrieve mongoose schemas.
The Mongoose Schema Registry allows developers to register schemas without creating a mongoose model. This allows extension of schemas later on prior to registering those models.
The following quick example should help you get started (taken from the ghiraldi framework mvc.js file):
File1.js
// First, declare the registry object.
var registry = require('mongoose-schema-registry'),
// The registry fires events when schemas are added.
registry.on('add', function(tag, schema) {
// tag contains the name you gave the schema when you added it.
// schema is the actual schema added.
});
// Add a schema to the registry using the add method
registry.add('schema_name', schema);
You can modify an existing schema by calling the getSchema method. Since the registry is a singleton, requiring will give you the same object with the already registered schemas.
// File2.js
var registry = require('mongoose-schema-registry');
var testSchema = registry.getSchema('testSchema');
// From here, you can add things to your test schema.
..
// When you're done, just re-add the schema. The new one will clobber
// the old one.
registry.add('testSchema', testSchema);
To finally register the schemas into mongoose models, just iterate through the schemas and call the mongoose.model method.
var keys = registry.getKeys();
_.each(keys, function(key, index, list) {
var thisSchema = registry.getSchema(key);
mongoose.model(key, thisSchema);
});
FAQs
Creates a schema registry that can be used to store and retrieve mongoose schemas.
We found that mongoose-schema-registry 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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.