Skip to content

Continuation local storage mongoose shimmer

License

Notifications You must be signed in to change notification settings

BuildingConnected/cls-mongoose

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Continuation local storage mongoose shimmer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%