moleculer-db icon indicating copy to clipboard operation
moleculer-db copied to clipboard

Mongo/Mongoose Adapter

Open flaviocordova opened this issue 6 years ago • 1 comments

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.

flaviocordova avatar Jan 11 '19 12:01 flaviocordova

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

icebob avatar Jan 11 '19 17:01 icebob