diff --git a/lib/aggregate.js b/lib/aggregate.js index 3704869f748..d38fa91dbc6 100644 --- a/lib/aggregate.js +++ b/lib/aggregate.js @@ -39,7 +39,7 @@ const readConcern = Query.prototype.readConcern; * ```javascript * new Aggregate([{ $match: { _id: '00000000000000000000000a' } }]); * // Do this instead to cast to an ObjectId - * new Aggregate([{ $match: { _id: mongoose.Types.ObjectId('00000000000000000000000a') } }]); + * new Aggregate([{ $match: { _id: new mongoose.Types.ObjectId('00000000000000000000000a') } }]); * ``` * * @see MongoDB http://docs.mongodb.org/manual/applications/aggregation/