fh-cls-mongoose
v2.1.1
Published
Continuation-local-storage (CLS) mongoose shim
Downloads
15
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('fh-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.