moleculer-mongodb
v1.0.9
Published
Mongodb adapter for moleculer
Downloads
3
Readme
MongoDB native adapter for Moleculer broker
Настройка
MONGO_URL=mongodb://host:port/database
MONGO_DB=database
Использование
const MongoDbClient = require("moleculer-mongodb");
module.exports = {
mixins: [MongoDbClient()],
actions: {
async test(ctx) {
const Users = await this.$db.collection('users'); // this.$db - instance of Mongodb
}
}
}