mongodb update to 4.0


mongodb update to 4.0



I'm upgrading from mongodb 3.6 to mongodb 4.0 and have problem with aggregates (it seems).


mongodb 3.6


mongodb 4.0



I've got this error:



TypeError: Cannot read property 'n' of undefinedn at
result.toArray
(/eliot-local-git/node_modules/mongodb/lib/operations/collection_ops.js:237:46)n
at result
(/eliot-local-git/node_modules/mongodb/lib/utils.js:414:17)n at
executeCallback
(/eliot-local-git/node_modules/mongodb/lib/utils.js:406:9)n at
handleCallback
(/eliot-local-git/node_modules/mongodb/lib/utils.js:128:55)n at
cursor.close
(/eliot-local-git/node_modules/mongodb/lib/operations/cursor_ops.js:218:62)n at handleCallback
(/eliot-local-git/node_modules/mongodb/lib/utils.js:128:55)n at
completeClose
(/eliot-local-git/node_modules/mongodb/lib/cursor.js:887:14)n at
_endSession (/eliot-local-git/node_modules/mongodb/lib/cursor.js:898:37)n at
AggregationCursor.Cursor._endSession
(/eliot-local-git/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:193:5)n
at AggregationCursor.Cursor._endSession
(/eliot-local-git/node_modules/mongodb/lib/cursor.js:226:59)n at
AggregationCursor.Cursor.close
(/eliot-local-git/node_modules/mongodb/lib/cursor.js:898:19)n at
cursor._next
(/eliot-local-git/node_modules/mongodb/lib/operations/cursor_ops.js:218:23)n at handleCallback
(/eliot-local-git/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:202:5)n
at _setCursorNotifiedImpl
(/eliot-local-git/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:560:38)n
at self._endSession
(/eliot-local-git/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:568:46)n
at AggregationCursor.Cursor._endSession
(/eliot-local-git/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:193:5)



My aggregate call look like :


collectionSchema.aggregate(query).exec();



Using :



mongodb v4.0.0



enter image description here



I've tried to use cursor aswell but it ain't worked:


collectionSchema.aggregate(query)
.cursor({
batchSize: 10
})
.exec();









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Extract Id from Twitch Clip URL

Why are these constructs (using ++) undefined behavior in C?

I'm Still Waiting (Diana Ross song)