moleculerjs / moleculer-db

:battery: Database access service mixins for Moleculer
https://moleculer.services/
MIT License
152 stars 122 forks source link

Mongo/Mongoose Adapter #75

Open flaviocordova opened 5 years ago

flaviocordova commented 5 years ago

It'd be really nice if I could create Mongo/Mongoose Adapters using a connection object instead of a connection string.

I want to create some mocha tests and today I have to keep a database running (in memory or full) to be able to connect to it. By being able to initialise mongoose adapter using a connection, I could use mongoose-mock or some other mock api.

icebob commented 5 years ago

Good idea, could you create a PR?

E.g. you can check that the uri is a connection object https://github.com/moleculerjs/moleculer-db/blob/2495439daed36abec823cdebc090e5d332de9329/packages/moleculer-db-adapter-mongoose/src/index.js#L22