gordonmleigh / promised-mongo

Node.js module that implements the offical mongo api
Other
160 stars 36 forks source link

Aggregate function is broken #27

Open andrewsumskoy opened 9 years ago

andrewsumskoy commented 9 years ago

MongoError: exception: pipeline element 0 is not an object but callback is work now

gordonmleigh commented 9 years ago

Thanks for the report. Can you show me a minimal code example that produces this error?

sjmeverett commented 9 years ago

This is because aggregate has changed: the old version of promised-mongo took an array into aggregate, but the new version expects the pipeline stages as an argument list. We'll probably need to chuck something into the compatibility function for it.

On 16 July 2015 at 13:45, Gordon Mackenzie-Leigh notifications@github.com wrote:

Thanks for the report. Can you show me a minimal code example that produces this error?

— Reply to this email directly or view it on GitHub https://github.com/gordonmleigh/promised-mongo/issues/27#issuecomment-121946795 .

yangchristian commented 9 years ago

:+1: Just ran into this today. Our app code unfortunately broke upon updating from v0.11.6 since we use aggregate with the array format for the pipeline param. I believe that is still the official Mongo API: http://docs.mongodb.org/manual/reference/method/db.collection.aggregate/

cfreman commented 9 years ago

Is there any fix or workaround for this?

yangchristian commented 9 years ago

My team implemented a fix in our fork (+ some other fixes) here: https://github.com/CrossLead/promised-mongo/tree/crosslead-release

We also submitted an outstanding PR with just this fix: https://github.com/gordonmleigh/promised-mongo/pull/41

cfreman commented 9 years ago

@yangchristian thank you. I had seen the PR but not the new fork. Great job!