File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
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 {
@@ -248,8 +248,7 @@ export class CursorResponse extends MongoDBResponse {
248
248
249
249
public get id ( ) : Long {
250
250
try {
251
- const cursorId = this . cursor . get ( 'id' , BSONType . long , false ) ;
252
- return cursorId ? Long . fromBigInt ( cursorId ) : Long . fromBigInt ( 0n ) ;
251
+ return Long . fromBigInt ( this . cursor . get ( 'id' , BSONType . long , true ) ) ;
253
252
} catch ( cause ) {
254
253
throw new MongoUnexpectedServerResponseError ( cause . message , { cause } ) ;
255
254
}
You can’t perform that action at this time.
0 commit comments