2.3.2 • Published 4 years ago

services-db-mixin v2.3.2

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

Rancagua Digital Moleculer DB Mixin

Description

Moleculer Mixin to provide a MongoDB database interface to Moleculer microservices.

Installation

npm install services-db-mixin or yarn add services-db-mixin

Usage

When defining your Moleculer service add the DBService as a mixin:

const DBService = require('services-db-mixin')

module.exports = {
  name: '<service-name>',
  version: 1,

  mixins: [
    DbService(
      '<bd-url> or an empty string to use MONGO_URI env var',
      '<collection-name>',
      { version: 1, name: '<logging-service-name>', action: '<service-action-to-call>' }),
  ],
  ...
}

NOTE: If you don't pass a database url or don't set the MONGODBURI env var, This package will use _moleculer-db MemoryAdapter. This is usefull for running tests without hitting the database.

2.3.2

4 years ago

2.3.1

4 years ago

2.2.9

4 years ago

2.3.0

4 years ago

2.2.8

4 years ago

2.1.8

5 years ago

2.0.8

5 years ago

2.0.7

5 years ago

2.0.6

5 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.0

5 years ago

1.0.0

5 years ago