Skip to content

Commit 53d4f38

Browse files
authored
Update lib/connection.js
1 parent c4935c7 commit 53d4f38

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/connection.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1230,7 +1230,9 @@ Connection.prototype.model = function(name, schema, collection, options) {
12301230
return sub;
12311231
}
12321232

1233-
model = this.models[name];
1233+
if (arguments.length === 1) {
1234+
return this.models[name];
1235+
}
12341236

12351237
if (!model) {
12361238
throw new MongooseError.MissingSchemaError(name);

0 commit comments

Comments
 (0)