cls-mongoose

Continuation-local-storage (CLS) mongoose shim

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
cls-mongoose
2.0.19 years ago9 years agoMinified + gzip package size for cls-mongoose in KB

Readme

CLS shimmer for Mongoose
Adds CLS wrapper for Mongoose, making mongoose safe to use with continuation-local-storage.
Usage:
var cls = require('continuation-local-storage');
var clsMongoose = require('cls-mongoose');

// or cls.getNamespace if exists
var clsns = cls.createNamespace('app');

var mongoose = require('mongoose');
clsMongoose(clsns);

After mongoose is patched, use it as usual.