You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I have different db connections (for example one default: mongoose, and one custom: db)
and create models:
first:
Book = mongoose.model('Book', BookSchema)
then:
Book2 = db.model('Book', BookSchema2)
Book2 would actually have BookSchema (not BookSchema2) schema, if I call model Book2 it works
Book2 = db.model('Book2', BookSchema2)
(but then I need to point out the collection name because it is books, not book2s)
Why is this?
The text was updated successfully, but these errors were encountered:
If I have different db connections (for example one default: mongoose, and one custom: db)
and create models:
first:
Book = mongoose.model('Book', BookSchema)
then:
Book2 = db.model('Book', BookSchema2)
Book2 would actually have BookSchema (not BookSchema2) schema, if I call model Book2 it works
Book2 = db.model('Book2', BookSchema2)
(but then I need to point out the collection name because it is books, not book2s)
Why is this?
The text was updated successfully, but these errors were encountered: