An ambitious ORM for MongoDB for Node.js, built on top of wires-domain service injection. Current stable version is 1.6.61. It provides model mapping, automatic join queries, schema validation with required, unique, min/max length, custom validators, and text index creation. Unlike Mongoose, it focuses on simplicity and promises, requiring manual connection setup via a domain service and supporting MongoDB 2.x-3.x. Release cadence is irregular with infrequent updates.
npm install wires-mongoNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to set up a connection via wires-domain, define a model with schema, and save a document.
Install wires-domain and register a '$db' service that returns a MongoClient connection.
Use a function validator to check for null or empty values.
Use MongoClient.connect() with promise or use native driver's newer options.
Ensure collection exists before calling createAllIndexes().
Use MongoDB index for scalar unique constraints.
Install and require wires-domain before using wires-mongo.
Use const Model = require('wires-mongo');Ensure the connected user has readWrite permissions on the target database.
Set name property before saving.
Check that wires-domain is configured and the MongoDB server is running.