1.0.3 • Published 3 years ago

mojahed-mongoose-model v1.0.3

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

Installation

Using npm:

$ cd <your-project-directory>
$ npm i mojahed-mongoose-model
Inside package.json add to scripts :
"make:model" : "node ./node_modules/mojahed-mongoose-model/commands/make_model.js",
"make:model-structure" : "node ./node_modules/mojahed-mongoose-model/commands/structure.js"
run :
$ npm run make:model-structure
Inside config/default.json update DB_URL:
{
    "DB_URL" : "<MongoDB_url>"
}

Usage

$ npm run make:model User

User Model will be created inside project-directory/models/

Inside other javascript file :
const User = require('./models/User');

await User.create({
    'name' : '< name >',
    'email' : '< email >',
    ...
});

Related package :

More About Mongoose Model

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago