api-model-mongoose
v3.1.0
Published
Data Model factory for api-core based APIs using MongoDB as a data source.
Downloads
37
Readme
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());