1.0.6 • Published 3 years ago

crud-nestjs-mongoose-helper v1.0.6

Weekly downloads
-
License
ISC
Repository
gitlab
Last release
3 years ago

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.

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago