@arcblock/did-auth-storage-mongo

1.7.1 • Public • Published

did-auth-storage-mongo

styled with prettier

Storage engine that uses mongo to store data, implements interfaces defined in @arcblock/did-auth-storage.

Table of Contents

Install

npm install @arcblock/did-auth-storage-mongo
// or
yarn add @arcblock/did-auth-storage-mongo

Usage

const MongoStorage = require('@arcblock/did-auth-storage-mongo');

const storage = new MongoStorage({
  url: 'mongodb://localhost/forge-web-starter',
  collection: 'did_auth_tokens',
});

// Listen on events of the storage
storage.on('create', d => console.log('create', d));
storage.on('update', d => console.log('update', d));
storage.on('destroy', d => console.log('destroy', d));

(async () => {
  const token = '123456';
  const item = await storage.create(token);
})();

Contributors

Name Website
wangshijun https://ocap.arcblock.io

Package Sidebar

Install

npm i @arcblock/did-auth-storage-mongo

Weekly Downloads

0

Version

1.7.1

License

Apache-2.0

Unpacked Size

10.1 kB

Total Files

5

Last publish

Collaborators

  • wangshijun
  • polunzh
  • mave99a
  • gxw