File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -232,7 +232,7 @@ export class CursorResponse extends MongoDBResponse {
232
232
* It is an optimization to avoid an extra getMore when the limit has been reached
233
233
*/
234
234
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 : [ ] } } ) ) ;
236
236
}
237
237
238
238
static override is ( value : unknown ) : value is CursorResponse {
@@ -247,12 +247,8 @@ export class CursorResponse extends MongoDBResponse {
247
247
}
248
248
249
249
public get id ( ) : Long {
250
- if ( ! this . cursor . has ( 'id' ) ) {
251
- throw new MongoUnexpectedServerResponseError ( '"id" is missing' ) ;
252
- }
253
250
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 ) ) ;
256
252
} catch ( cause ) {
257
253
throw new MongoUnexpectedServerResponseError ( cause . message , { cause } ) ;
258
254
}
You can’t perform that action at this time.
0 commit comments