|
This is somewhat similar to the "out" parameter for the mapReduce command. Documentation for the feature is available in the release notes here:
http://docs.mongodb.org/manual/release-notes/2.6/#out-stage-to-write-data-to-a-collection
The drivers spec is available here:
https://github.com/mongodb/specifications/blob/master/source/out-aggregation-pipeline-operator.rst
Here's an example of using $out, with the result message:
> db.test.aggregate( { $project : { x : 1 } }, { $out : "out" } )
|
{ "result" : [ ], "ok" : 1 }
|
|