0.1.0 • Published 5 years ago

@clearroad/api-storage-mongodb v0.1.0

Weekly downloads
1
License
GPL-3.0-or-later
Repository
github
Last release
5 years ago

ClearRoad API Storage MongoDB

Note: 5 databases will be created to store the data, all prefixed with the database value (see below). Make sure you use credentials that have the rights to create databases.

Install

npm install @clearroad/api-storage-mongodb

Usage

  1. Import the library:

    Using with es6 / TypeScript

import { ClearRoad } from '@clearroad/api';
import storage from '@clearroad/api-storage-mongodb';

Using with require

const ClearRoad = require('@clearroad/api').ClearRoad;
const storage = require('@clearroad/api-storage-mongodb').default;
  1. Create a ClearRoad instance:
const options = {
  localStorage: {
    type: storage,
    url: 'mongodb://user:password@host.com:27017',
    database: 'MyDatabase'
  }
};
const cr = new ClearRoad('url', 'accessToken', options);

Options

PropertyTypeDescriptionRequired
localStorage.typestringConnector type. Use mongodbYes
localStorage.urlstringDatabase url connection stringYes
localStorage.databasestringDatabase nameYes
localStorage.clientOptionsMongoClientOptions (see connect options)Additional configuration for connectionNo
localStorage.documentsCollectionNamestringDatabase collection name to storage all documents. Default is DocumentsNo
localStorage.attachmentsCollectionNamestringDatabase table name to storage all attachments. Default is AttachmentsNo
localStorage.timestampsbooleanAdd createdAt and updateAt fields on each row. Default is trueNo
0.1.0

5 years ago

0.1.0-alpha.9

5 years ago

0.1.0-alpha.8

5 years ago

0.1.0-alpha.7

5 years ago

0.1.0-alpha.6

5 years ago

0.1.0-alpha.5

5 years ago

0.1.0-alpha.4

5 years ago

0.1.0-alpha.3

5 years ago

0.1.0-alpha.2

6 years ago

0.1.0-alpha.1

6 years ago

0.1.0-alpha.0

6 years ago

0.0.1-rc.24

6 years ago

0.0.1-rc.23

6 years ago

0.0.1-rc.22

6 years ago

0.0.1-rc.21

6 years ago

0.0.1-rc.20

6 years ago

0.0.1-rc.19

6 years ago

0.0.1-rc.18

6 years ago

0.0.1-rc.17

6 years ago

0.0.1-rc.16

6 years ago

0.0.1-rc.15

6 years ago

0.0.1-rc.14

6 years ago

0.0.1-rc.13

6 years ago

0.0.1-rc.12

6 years ago

0.0.1-rc.11

6 years ago

0.0.1-rc.10

6 years ago

0.0.1-rc.9

6 years ago

0.0.1-rc.8

6 years ago

0.0.1-rc.7

6 years ago

0.0.1-rc.6

6 years ago

0.0.1-rc.5

6 years ago

0.0.1-rc.4

6 years ago

0.0.1-rc.3

6 years ago

0.0.1-rc.2

6 years ago

0.0.1-rc.1

6 years ago

0.0.1

6 years ago