mongo-aggregate-out

0.0.1 • Public • Published

mongo-aggregate-out

Save aggregation results in a collection for Mongo < 2.6.

Starting from MongoDB 2.6 a new feature has been added to the aggregation framework. This feature is to store results of an aggregation pipeline to a new collection.

This module adds a legacy support for this feature.

If your MongoDB version is 2.6 or newer, the module would behave as passthrough and will use the native feature.

Usage

var aggregateOut = require('mongo-aggregate-out');
 
aggregateOut(collection, pipelineArray, {out: "newCollection"}, function (err) {
  var cur = db.collection('newCollection').find();
});

install

With npm do:

npm install mongo-aggregate-out

license

MIT

Package Sidebar

Install

npm i mongo-aggregate-out

Weekly Downloads

2

Version

0.0.1

License

none

Last publish

Collaborators

  • tounano