CampbellSoftwareSolutions / mongoose-id-validator

Mongoose plug in to validate ObjectID references point to valid existing documents.
Other
47 stars 26 forks source link

createConnection doesn't resolve promisse #18

Closed FeeFelipe closed 7 years ago

FeeFelipe commented 7 years ago

Hi,

I've had to change my application to use "let conn = mongoose.createConnection" it's change created a bug in my application, the initial request stay in loading and doesn't return the response.

When i've used 'mongoose.connect' this plugin works very well!

martin-css commented 7 years ago

Have you set the connection field in the options object when you call model.plugin?

See the readme. If you're using a custom created connection then this needs to be passed to the plugin. The plugin assumes you are using the default connection (i.e. mongoose.connect) if this is not set.

Let me know if this doesn't work.

FeeFelipe commented 7 years ago

Thanks it works

martin-css commented 7 years ago

:+1: