0.0.4 • Published 3 years ago

loopback-connector-nedb v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

loopback-connector-nedb

The unofficial NeDB connector for the LoopBack framework. This is currently a rough fork of MongoDB driver migrated to NeDB as the db interface should be compatible for basic feature. It is a work in progress.

Installation

In your application root directory, enter this command to install the connector:

npm install loopback-connector-nedb --save

This installs the module from npm and adds it as a dependency to the application's package.json file.

If you create a NeDB data source using the data source generator as described below, you don't have to do this, since the generator will run npm install for you.

Supported versions

Starting from the version 6.0.0, this connector is no longer compatible with LoopBack 3. Please use the latest 5.x version in your LoopBack 3 applications.

This module adopts the Module Long Term Support (LTS) policy, with the following End Of Life (EOL) dates:

VersionStatusPublishedEOLLoopBackJuggler
6.xCurrentMar 2021Apr 2023 (minimum)44.x
5.xActive LTSJun 2019Apr 20233, 43.x, 4.x
4.xMaintenance LTSNov 2018Apr 20213, 43.x, 4.x

Creating a NeDB data source

For LoopBack 4 users, use the LB4 Command-line interface to generate a DataSource with NeDB connector to your LB4 application.

The configuration can be found under src/datasources/<DataSourceName>.datasource.ts, basic options shnould look like this:

const config = {
  name: 'db',
  connector: 'ne',
  root: './database',
  stores: [ 'Users', 'AccessTokens', 'MyModel']
};

If your username or password contains special characters like @, $ etc, encode the whole username or password using encodeURIComponent.

Eg: pa$$wd would become pa%24%24wd.

Connection properties

PropertyType  Description
connectorStringConnector name, either "loopback-connector-nedb" or "nedb".
nameStringName of the datasource in the app
rootStringRoot path of database folder
storesString[]Names of the datasource files for collections