crud-nestjs-mongoose-helper
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

crud-nestjs-mongoose-helper

Description

crud-nestjs-mongoose-helper a microservice to help nodejs/nestjs mongodb developers to speed up the creation of their crud with a minimum of code.

Installation

$ npm install

Use

import { exist, create, createIfne, one, all, allDistinct, put, destroy } from "crud-nestjs-mongoose-helper/index"

verify if model exist

const data = await exist(databaseTableModel, {field: value});

create a model

const data = await create(databaseTableModel, body, 'onePopulateTable', fieldsToTakeInThePopulateTable);

create a model if not exist

const data = await createIfne(databaseTableModel, body, 'onePopulateTable', fieldsToTakeInThePopulateTable);

find a model

const data = await one(databaseTableModel, filterParams, fieldsToTakeInTheTable, 'onePopulateTable', fieldsToTakeInThePopulateTable);

find many models

const data = await all(databaseTableModel, filterParams, fieldsToTakeInTheTable, sortParams, limitLength 'onePopulateTable', fieldsToTakeInThePopulateTable);

find distinct models

const data = await allDistinct(databaseTableModel, 'onePopulateTable', filterParams);

#update a model const data = await put(databaseTableModel, body, filterParams, 'onePopulateTable', fieldsToTakeInThePopulateTable);

delete a model

const data = await destroy(databaseTableModel, filterParams);

Support

crud-nestjs-mongoose-helper is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join me, please read more here.

Stay in touch

License

crud-nestjs-mongoose-helper is MIT licensed.

Package Sidebar

Install

npm i crud-nestjs-mongoose-helper

Weekly Downloads

1

Version

1.0.6

License

ISC

Unpacked Size

121 kB

Total Files

16

Last publish

Collaborators

  • acho-bestman