Skip to content

Commit f89a67b

Browse files
committed
docs(model): clean up some docs re: aggregate()
1 parent 0729b23 commit f89a67b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/model.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3885,9 +3885,8 @@ Model.mapReduce = function mapReduce(o, callback) {
38853885
*
38863886
* ####NOTE:
38873887
*
3888-
* - Arguments are not cast to the model's schema because `$project` operators allow redefining the "shape" of the documents at any stage of the pipeline, which may leave documents in an incompatible format.
3888+
* - Mongoose does **not** cast aggregation pipelines to the model's schema because `$project` and `$group` operators allow redefining the "shape" of the documents at any stage of the pipeline, which may leave documents in an incompatible format. You can use the [mongoose-cast-aggregation plugin](https://github.com/AbdelrahmanHafez/mongoose-cast-aggregation) to enable minimal casting for aggregation pipelines.
38893889
* - The documents returned are plain javascript objects, not mongoose documents (since any shape of document can be returned).
3890-
* - Requires MongoDB >= 2.1
38913890
*
38923891
* @see Aggregate #aggregate_Aggregate
38933892
* @see MongoDB http://docs.mongodb.org/manual/applications/aggregation/

0 commit comments

Comments
 (0)