Skip to content

bro-jo/aedes-persistence-mongodb

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aedes-persistence-mongodb

Aedes persistence, backed by MongoDB.

See aedes-persistence for the full API, and Aedes for usage.

Install

npm i aedes aedes-persistence-mongodb --save

API

aedesPersistenceMongoDB([opts])

Creates a new instance of aedes-persistence-mongodb. It accepts a connections string url or you can pass your existing db object. Also, you can choose to set a ttl (time to live) for your subscribers or packets. This option will help you to empty your db from keeping useless data.

Example:

aedesPersistenceMongoDB({
  url: 'mongodb:https://127.0.0.1/aedes-test', // Optional when you pass db object
  // Optional ttl settings
  ttl: {
      packets: 300, // Number of seconds
      subscriptions: 300,
  }
})

Or

aedesPersistenceMongoDB({
 db:db
})

License

MIT

About

MongoDB persistence for Aedes

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • JavaScript 100.0%