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 {
698
698
) ;
699
699
}
700
700
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
+ */
702
705
unref ( ) : void {
703
706
getTopology ( this ) . unref ( ) ;
704
707
}
Original file line number Diff line number Diff line change @@ -770,8 +770,11 @@ export class Topology extends TypedEventEmitter<TopologyEvents> {
770
770
return this . s . state === STATE_CLOSED ;
771
771
}
772
772
773
+ /**
774
+ * @deprecated This function is deprecated and will be removed in the next major version.
775
+ */
773
776
unref ( ) : void {
774
- emitWarning ( 'not implemented: `unref`' ) ;
777
+ emitWarning ( '`unref` is a noop and will be removed in the next major version ' ) ;
775
778
}
776
779
777
780
// 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';
4
4
import { AggregationCursor } from '../../src/cursor/aggregation_cursor' ;
5
5
import type { FindCursor } from '../../src/cursor/find_cursor' ;
6
6
import type { Document } from 'bson' ;
7
+ import { Db } from '../../src' ;
8
+ import { Topology } from '../../src/sdam/topology' ;
7
9
8
10
// We wish to keep these APIs but continue to ensure they are marked as deprecated.
9
11
expectDeprecated ( Collection . prototype . insert ) ;
10
12
expectDeprecated ( Collection . prototype . update ) ;
11
13
expectDeprecated ( Collection . prototype . remove ) ;
12
14
expectDeprecated ( Collection . prototype . count ) ;
13
15
expectDeprecated ( AggregationCursor . prototype . geoNear ) ;
16
+ expectDeprecated ( Topology . prototype . unref ) ;
17
+ expectDeprecated ( Db . prototype . unref ) ;
14
18
15
19
// test mapped cursor types
16
20
const client = new MongoClient ( '' ) ;
You can’t perform that action at this time.
0 commit comments