2.2.0 • Published 10 months ago

@3kles/3kles-coremongodb v2.2.0

Weekly downloads
96
License
ISC
Repository
-
Last release
10 months 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.

2.2.0

10 months ago

1.6.3

1 year ago

1.6.2

1 year ago

1.7.0

1 year ago

2.1.2

1 year ago

2.1.1

1 year ago

2.0.2

1 year ago

2.1.4

12 months ago

2.1.3

12 months ago

2.1.0

1 year ago

2.0.0

1 year ago

1.6.1

1 year ago

1.6.0

2 years ago

1.5.4

2 years ago

1.5.3

2 years ago

1.5.2

2 years ago

1.5.1

2 years ago

1.5.0

2 years ago

1.4.1

2 years ago

1.4.0

3 years ago

1.3.1

3 years ago

1.2.7

3 years ago

1.3.0

3 years ago

1.2.6

4 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago