Alterior MongoDB Support
Use this package if you want to connect to MongoDB from your Alterior application.
Accessing MongoDB from Alterior
npm i mongodb @alterior/mongo
mongoProvider to inject an instance of
mongodb.Db into your application:
Now, you can inject
mongodb.Db into your controllers:
You can pass any token into
mongoProvider, which can be used to inject multiple database connections if necessary.
Storing Sessions in MongoDB
This package also provides a connector for storing Express sessions in MongoDB using
You can then access and modify session data from your route methods. We recommend you make an interface representing your session data.