Document mongoose.connections
#7338
Labels
docs
This issue is due to a mistake or omission in the mongoosejs.com documentation
Milestone
Do you want to request a feature or report a bug?
feature
What is the current behavior?
When trying to access the default connection
mongoose.connection
is a nice way for other files to access models viamongoose.model('Model')
. However when you have multiple connections viacreateConnection
there's no nice way for other files to access the model. Yes I know there'sconn.useDb('asdf').model('Model')
but that only works if the connection has been made and access to thatconn
object is done.With the default connection this is trivial because
mongoose.model
doesn't care if the default connection is even up and running yet, but when you're trying to access a model that's been registered on a connection withcreateConnection
it immediately checks if the model has been registered on that connection.The text was updated successfully, but these errors were encountered: