Skip to content

Commit e47b669

Browse files
committedJul 30, 2018
fix(populate): make error reported when no localField specified catchable
Fix #6767
1 parent 1e27f09 commit e47b669

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed
 

‎docs/source/api.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,7 @@ function parse() {
104104
}
105105
}
106106

107-
if (ctx.string.includes('Model')) {
108-
console.log(ctx);
109-
}
107+
console.log(ctx);
110108

111109
// Backwards compat
112110
if (typeof ctx.constructor === 'string') {

‎lib/model.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3946,7 +3946,7 @@ function getModelsMapForPopulate(model, docs, options) {
39463946
}
39473947

39483948
if (virtual && (!localField || !foreignField)) {
3949-
throw new Error('If you are populating a virtual, you must set the ' +
3949+
return new Error('If you are populating a virtual, you must set the ' +
39503950
'localField and foreignField options');
39513951
}
39523952

‎lib/query.js

+2
Original file line numberDiff line numberDiff line change
@@ -1180,6 +1180,8 @@ Query.prototype.wtimeout = function wtimeout(ms) {
11801180
*
11811181
* Read more about how to use read concern [here](https://docs.mongodb.com/manual/reference/read-concern/).
11821182
*
1183+
* @memberOf Query
1184+
* @method readConcern
11831185
* @param {String} level one of the listed read concern level or their aliases
11841186
* @see mongodb https://docs.mongodb.com/manual/reference/read-concern/
11851187
* @return {Query} this

0 commit comments

Comments
 (0)
Please sign in to comment.