adonisjs-mongoose-provider-br
v1.0.0
Published
Mongoose - mongoDb
Downloads
4
Maintainers
Readme
Install
Install with npm:
npm install adonisjs-mongoose-provider-br
Install with yarn:
yarn add adonisjs-mongoose-provider-br
##Config
Make sure to register the provider inside start/app.js
file.
const providers = ["adonisjs-mongoose-provider-br/MongooseProvider"];
Make a config file
adonis mongoose:config
And then your .env
file
MONGOOSE_HOST=127.0.0.1
MONGOOSE_USER=root
MONGOOSE_PASSWORD=123456
MONGOOSE_PORT=27017
MONGOOSE_DATABASE=project_db
MONGOOSE_AUTH_SOURCE=admin
##Make Schema You can initiate a Schema using adonis cli
adonis make:mongoose SchemaName
##Import mongoose with use("Mongo/Mongoose") or with alias use("Mongoose")