Biblioteca monguex utilitário das funções do mongoose
NPM - https://www.npmjs.com/package/monguex
Para instalar a biblioteca, utilize o seguinte comando:
npm install monguex
ou
yarn add monguex
Exemplos de como utilizar a biblioteca:
import {monguex} from 'monguex';
(async()=>{
await monguex.connect("URL_MONGOOSE")
const userProps = {
nome: String,
idade: Number,
email: String
};
const UserModel = monguex.createSchema('User',userProps,{timestamps:true})
await monguex.save(UserModel,{
nome: 'John Doex',
idade: 25,
email: 'john.doex@example.com',
})
})()