File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -975,6 +975,7 @@ Db.prototype.addChild = function(db) {
975
975
* @param {string } name The name of the database we want to use.
976
976
* @param {object } [options=null] Optional settings.
977
977
* @param {boolean } [options.noListener=false] Do not make the db an event listener to the original connection.
978
+ * @param {boolean } [options.returnNonCachedInstance=false] Control if you want to return a cached instance or have a new one created
978
979
* @return {Db }
979
980
*/
980
981
Db . prototype . db = function ( dbName , options ) {
@@ -985,7 +986,7 @@ Db.prototype.db = function(dbName, options) {
985
986
}
986
987
987
988
// Do we have the db in the cache already
988
- if ( this . s . dbCache [ dbName ] ) {
989
+ if ( this . s . dbCache [ dbName ] && options . returnNonCachedInstance !== true ) {
989
990
return this . s . dbCache [ dbName ] ;
990
991
}
991
992
You can’t perform that action at this time.
0 commit comments