api-model-mongoose
TypeScript icon, indicating that this package has built-in type declarations

3.1.0 • Public • Published

api-model-mongoose

Data Model factory for api-core based APIs using MongoDB as a data source.

Installation

npm install api-model-mongoose

Usage

const mongoose = require('mongoose'),
      MongooseModelFactory = require('api-model-mongoose').MongooseModelFactory;

const UserEdge =
    MongooseModelFactory.createModel("user", "users", {
        id: String,
        firstName: String,
        lastName: String,
        email: String,
        phone: String
    });
    
const API = new Api('1.0').edge(new UserEdge());

Readme

Keywords

none

Package Sidebar

Install

npm i api-model-mongoose

Weekly Downloads

1

Version

3.1.0

License

MIT

Unpacked Size

98.5 kB

Total Files

26

Last publish

Collaborators

  • ajuhos
  • lsc-deploy