fzaninotto / uptime

A remote monitoring application using Node.js, MongoDB, and Twitter Bootstrap.
http://fzaninotto.github.com/uptime/
MIT License
3.62k stars 703 forks source link

MongoDB 3.6 Version aggregate error #368

Open ne0c0de opened 6 years ago

ne0c0de commented 6 years ago

Hello,

I just installed the latest version of uptime with the latest version of NodeJS and MongoDB version with 3.6

But I'm getting this error on backend:

{ MongoError: The 'cursor' option is required, except for aggregate with the explain argument
    at Object.exports.toError (/uptime/node_modules/mongodb/lib/mongodb/utils.js:108:11)
    at /uptime/node_modules/mongodb/lib/mongodb/collection.js:1649:22
    at Cursor.nextObject (/uptime/node_modules/mongodb/lib/mongodb/cursor.js:653:5)
    at commandHandler (/uptime/node_modules/mongodb/lib/mongodb/cursor.js:635:14)
    at CallbackStore.<anonymous> (/uptime/node_modules/mongodb/lib/mongodb/db.js:1709:18)
    at Object.onceWrapper (events.js:273:13)
    at CallbackStore.emit (events.js:182:13)
    at Server.Base._callHandler (/uptime/node_modules/mongodb/lib/mongodb/connection/base.js:130:25)
    at /uptime/node_modules/mongodb/lib/mongodb/connection/server.js:522:20
    at exports.MongoReply.MongoReply.parseBody (/uptime/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:132:5)
  name: 'MongoError',
  ok: 0,
  errmsg:
   'The \'cursor\' option is required, except for aggregate with the explain argument',
  code: 9,
  codeName: 'FailedToParse' }

I got this error on my other owned app and resolve it by updating aggregate functions to enforce them to use cursor. Is there any patch like this on this repo?

ne0c0de commented 6 years ago

I resolved my problem by downgrading MongoDB to 3.0 version.

keshrisohit commented 6 years ago

works with mongo3.2 as well