Need private packages and team management tools?Check out npm Teams »

api-model-mongoose

0.24.9 • 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());

Keywords

none

Install

npm i api-model-mongoose

DownloadsWeekly Downloads

169

Version

0.24.9

License

MIT

Unpacked Size

89.2 kB

Total Files

26

Last publish

Collaborators

  • avatar