@ewb/mongoose-query-express
TypeScript icon, indicating that this package has built-in type declarations

1.0.8 • Public • Published

Mongoose Query Express

Info

Library to for Express to create simple reusable queries and logic for mongoose.
Never write the simple get, post, patch and delete function over and over again.\

Used in combination with mongoose-query to create the model logic.\

Usage

import { QueryExpress, QueryModel, QueryOptions } from 'mongoose-query-express';

const options = new QueryOptions({ .... });
const userQueryModel = new QueryModel<User>(User, options);
const userQuery = new QueryExpress('user', userQueryModel, {...});

const user = express();

user.param('id', userQuery.param);
user.get('/', userQuery.get);
user.post('/', userQuery.post);
user.patch('/:id', userQuery.patch);
user.delete('/:id', userQuery.delete); // Can also use userQuery.archive if archive option set.

Package Sidebar

Install

npm i @ewb/mongoose-query-express

Weekly Downloads

0

Version

1.0.8

License

MIT

Unpacked Size

25.4 kB

Total Files

14

Last publish

Collaborators

  • emilswebbod