/node-mongo-tenant

A multi-tenancy plugin for mongoose with tenant separation on document level. It's completely customizable, provides a neat interface for model-tenant-binding and can be disabled for running in single-tenant/on premis scenarios.

Primary LanguageJavaScriptMIT LicenseMIT

Multi Tenancy Plugin for Mongoose

Install

$ npm install --save mongo-tenant

Use

Register the plugin on the relevant mongoose schema.

const
  mongoose = require('mongoose'),
  mongoTenant = require('mongo-tenant');

let MySchema = new mongoose.Schema({});
MySchema.plugin(mongoTenant);

LICENSE

The files in this archive are released under MIT license. You can find a copy of this license in LICENSE.