cls-mongoose-shim

0.0.8 • Public • Published

CLS shimmer for Mongoose

Adds CLS wrapper for Mongoose, making mongoose safe to use with continuation-local-storage.

This is a fork of iliakan/cls-mongoose and feedhenry/cls-mongoose compatible with mongose >= 4.5.0.

I will try to maintain with new mongoose versions. If a new version is out and not supported please open an issue or submit a pull request.

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.

Package Sidebar

Install

npm i cls-mongoose-shim

Weekly Downloads

0

Version

0.0.8

License

ISC

Unpacked Size

17.5 kB

Total Files

7

Last publish

Collaborators

  • wayglem