File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed
Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -698,7 +698,10 @@ export class Db {
698698 ) ;
699699 }
700700
701- /** Unref all sockets */
701+ /**
702+ * Unref all sockets
703+ * @deprecated This function is deprecated and will be removed in the next major version.
704+ */
702705 unref ( ) : void {
703706 getTopology ( this ) . unref ( ) ;
704707 }
Original file line number Diff line number Diff line change @@ -770,8 +770,11 @@ export class Topology extends TypedEventEmitter<TopologyEvents> {
770770 return this . s . state === STATE_CLOSED ;
771771 }
772772
773+ /**
774+ * @deprecated This function is deprecated and will be removed in the next major version.
775+ */
773776 unref ( ) : void {
774- emitWarning ( 'not implemented: `unref`' ) ;
777+ emitWarning ( '`unref` is a noop and will be removed in the next major version ' ) ;
775778 }
776779
777780 // NOTE: There are many places in code where we explicitly check the last isMaster
Original file line number Diff line number Diff line change @@ -4,13 +4,17 @@ import { Collection } from '../../src/collection';
44import { AggregationCursor } from '../../src/cursor/aggregation_cursor' ;
55import type { FindCursor } from '../../src/cursor/find_cursor' ;
66import type { Document } from 'bson' ;
7+ import { Db } from '../../src' ;
8+ import { Topology } from '../../src/sdam/topology' ;
79
810// We wish to keep these APIs but continue to ensure they are marked as deprecated.
911expectDeprecated ( Collection . prototype . insert ) ;
1012expectDeprecated ( Collection . prototype . update ) ;
1113expectDeprecated ( Collection . prototype . remove ) ;
1214expectDeprecated ( Collection . prototype . count ) ;
1315expectDeprecated ( AggregationCursor . prototype . geoNear ) ;
16+ expectDeprecated ( Topology . prototype . unref ) ;
17+ expectDeprecated ( Db . prototype . unref ) ;
1418
1519// test mapped cursor types
1620const client = new MongoClient ( '' ) ;
You can’t perform that action at this time.
0 commit comments