1.0.5 • Published 8 years ago

mongo-aggregator v1.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
8 years ago

npm i mongo-aggregator

There are three methods:

  1. expander.expandOne(childPath, projection, childCollectionName) for expand simple (not array) field.

  2. expander.expandMany(childPath, projection, childCollectionName) for expand array field.

  3. expander.expandManyWithChildProjection = function (childPathName, projection, childProjection, childCollectionName) for expand array field with projection for child documents.

    A result of functions will be aggregation obj.
    
    Next:
    
    // mongoose
    MyModel.aggregate(aggregationObj, function(err, myModels) {
        ...
    });
    
    // or mongo driver
    db.collection('myCollection').aggregate(aggregationObj, function(err, myDocs) {
        ...
    });
1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago