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
I have multiple database in a SINGLE NodeJS project.
example:
var conn = mongoose.createConnection('mongodb://localhost/testA');
var conn2 = mongoose.createConnection('mongodb://localhost/testB');
// stored in 'testA' database
var ModelA = conn.model('Model', new mongoose.Schema({
title : { type : String, default : 'model in testA database' }
}));
// stored in 'testB' database
var ModelB = conn2.model('Model', new mongoose.Schema({
title : { type : String, default : 'model in testB database' }
}));
Then, I found this project get connection from mongoose.connection, but I don't set that. How to reslove?
I try to
fixtures.load(data, conn);
but failed.
The text was updated successfully, but these errors were encountered:
I have multiple database in a SINGLE NodeJS project.
example:
Then, I found this project get connection from
mongoose.connection
, but I don't set that. How to reslove?I try to
but failed.
The text was updated successfully, but these errors were encountered: