File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -232,7 +232,7 @@ export class CursorResponse extends MongoDBResponse {
232232 * It is an optimization to avoid an extra getMore when the limit has been reached
233233 */
234234 static get emptyGetMore ( ) : CursorResponse {
235- return new CursorResponse ( serialize ( { ok : 1 , cursor : { id : 0 , nextBatch : [ ] } } ) ) ;
235+ return new CursorResponse ( serialize ( { ok : 1 , cursor : { id : 0n , nextBatch : [ ] } } ) ) ;
236236 }
237237
238238 static override is ( value : unknown ) : value is CursorResponse {
@@ -247,12 +247,8 @@ export class CursorResponse extends MongoDBResponse {
247247 }
248248
249249 public get id ( ) : Long {
250- if ( ! this . cursor . has ( 'id' ) ) {
251- throw new MongoUnexpectedServerResponseError ( '"id" is missing' ) ;
252- }
253250 try {
254- const cursorId = this . cursor . get ( 'id' , BSONType . long , false ) ;
255- return cursorId != null ? Long . fromBigInt ( cursorId ) : Long . fromBigInt ( 0n ) ;
251+ return Long . fromBigInt ( this . cursor . get ( 'id' , BSONType . long , true ) ) ;
256252 } catch ( cause ) {
257253 throw new MongoUnexpectedServerResponseError ( cause . message , { cause } ) ;
258254 }
You can’t perform that action at this time.
0 commit comments