1.6.1 • Published 29 days ago

@3kles/3kles-coremongodb v1.6.1

Weekly downloads
96
License
ISC
Repository
-
Last release
29 days ago

@3kles/3kles-coremongodb

This package contains interface and class to create MongoDB Application

App

MongoDBApp is a class that extends GenericApp from @3kles/3kles-corebe:

  • urlmongodb: Set url to MongoDB
  • option: Set connect options for mongoose

Router

MongoDBRouter is a class to create a MongoDB router from a GenericRouter from @3kles/3kles-corebe

Controller

MongoDBController is a class to create a MongoDBController that extends from AbstractGenericController from @3kles/3kles-corebe

  • model: Define the model of document we store

Service

MongoDBService is a service that extends from AbstractGenericService from @3kles/3kles-corebe to do CRUD operations

Install

npm

npm install @3kles/3kles-coremongodb --save

How to use

How to create an app

const port = 30000;
const httpjsonapi: HttpApi = new HttpApi();
httpjsonapi.setResponseParser(new JSONParser());
httpjsonapi.setErrorParser(new JSONParser());

const documents = app.getMongoose().model<any>('documents', documentSchema);
app.addRoute(new MongoDBRouter(new MongoDBController(new MongoDBService(documents, httpjsonapi))).router);

app.initRoute();

app.startApp(port);

Check the documentation here.

1.6.1

29 days ago

1.6.0

3 months ago

1.5.4

4 months ago

1.5.3

7 months ago

1.5.2

9 months ago

1.5.1

11 months ago

1.5.0

11 months ago

1.4.1

11 months ago

1.4.0

1 year ago

1.3.1

1 year ago

1.2.7

2 years ago

1.3.0

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago