engined-mongodb
mongodb agent service for engined, which is based on mongoose.
Installation
Install via NPM:
npm install engined-mongodb
Usage
start mongodb agent service in engined, see example below:
const Manager = ;const MongoDBService = ; const MyMongoDB = ; const main = async { // Create manager let serviceManager = verbose: true ; // Adding agent to manager serviceManager; // Start all services await serviceManager;}; ;
Access MongoDB
Pretty easy to get agent from context and specify collection to get mongoose model. Then just operate database by mongoose way.
let agent = this; // Mongoose way to operate databaselet docs = await agent;
License
Licensed under the MIT License
Authors
Copyright(c) 2017 Fred Chien(錢逢祥) <cfsghost@gmail.com>