Hello everyone,

Currently, I’m facing the below error:

MongoRuntimeError: Unexpected null cursor id. A cursor creating command should have set this

This error is occurring when I’m trying to use nodejs driver for mongodb version 6.14.2.
Researched about the same and got to know that this is occurring for all the versions subsequently released from 6.8.0.
Cursor id is returning as null in response object for the aggregate, find and findOne query methods as well.

Following is the sample query for aggregate we are using. The similar query without any modification running perfectly fine on nodejs’s mongo driver version 6.5.0

let result = await this.collection .aggregate([ { $unwind: '$KEYS' }, { $match: query }, { $group: { _id: '$_id', KEYS: { $push: '$KEYS' } } } ], { noCursorTimeout: true } )

Can someone please help me on this issue as we are struggling to resolve since 3 weeks ?