@@ -20,7 +20,6 @@ import {
20
20
// Dependencies (options, etc.)
21
21
import type {
22
22
AbstractCursorEvents ,
23
- AddUserOptions ,
24
23
AggregateOptions ,
25
24
AnyBulkWriteOperation ,
26
25
BulkWriteOptions ,
@@ -31,8 +30,6 @@ import type {
31
30
ClientSessionOptions ,
32
31
CollectionInfo ,
33
32
CollectionOptions ,
34
- CollStats ,
35
- CollStatsOptions ,
36
33
CommandOperationOptions ,
37
34
CountDocumentsOptions ,
38
35
CountOptions ,
@@ -93,10 +90,10 @@ import type {
93
90
type NonConstructorKeys < T > = { [ P in keyof T ] : T [ P ] extends new ( ) => any ? never : P } [ keyof T ] ;
94
91
type NonConstructor < T > = Pick < T , NonConstructorKeys < T > > ;
95
92
96
- declare const Admin : new ( ) => Omit < MDBAdmin , 'addUser' | ' buildInfo' | 'command' | 'listDatabases' | 'ping' | 'removeUser' | 'replSetGetStatus' | 'serverInfo' | 'serverStatus' | 'validateCollection' > ;
93
+ declare const Admin : new ( ) => Omit < MDBAdmin , 'buildInfo' | 'command' | 'listDatabases' | 'ping' | 'removeUser' | 'replSetGetStatus' | 'serverInfo' | 'serverStatus' | 'validateCollection' > ;
97
94
declare const ChangeStream : new < TSchema extends Document = Document , TChange extends Document = ChangeStreamDocument < TSchema > > ( ) => Omit < MDBChangeStream < TSchema , TChange > , 'close' | 'hasNext' | 'next' | 'tryNext' > ;
98
- declare const Collection : new < TSchema > ( ) => Omit < MDBCollection < TSchema > , 'initializeUnorderedBulkOp' | 'initializeOrderedBulkOp' | 'bulkWrite' | 'count' | 'countDocuments' | 'estimatedDocumentCount' | 'createIndex' | 'createIndexes' | 'dropIndex' | 'dropIndexes' | 'deleteMany' | 'deleteOne' | 'distinct' | 'drop' | 'findOne' | 'findOneAndDelete' | 'findOneAndReplace' | 'findOneAndUpdate' | 'indexExists' | 'indexInformation' | 'indexes' | 'insertMany' | 'insertOne' | 'isCapped' | 'options' | 'rename' | 'replaceOne' | 'stats' | ' updateMany'| 'updateOne' | 'aggregate' | 'find' | 'listIndexes' | 'watch' > ;
99
- declare const Db : new ( ) => Omit < MDBDb , 'command' | 'addUser' | ' removeUser' | 'createCollection' | 'dropCollection' | 'createIndex' | 'dropDatabase' | 'indexInformation' | 'profilingLevel' | 'setProfilingLevel' | 'renameCollection' | 'stats' | 'collections' | 'collection' | 'admin' | 'aggregate' | 'listCollections' | 'watch' > ;
95
+ declare const Collection : new < TSchema > ( ) => Omit < MDBCollection < TSchema > , 'initializeUnorderedBulkOp' | 'initializeOrderedBulkOp' | 'bulkWrite' | 'count' | 'countDocuments' | 'estimatedDocumentCount' | 'createIndex' | 'createIndexes' | 'dropIndex' | 'dropIndexes' | 'deleteMany' | 'deleteOne' | 'distinct' | 'drop' | 'findOne' | 'findOneAndDelete' | 'findOneAndReplace' | 'findOneAndUpdate' | 'indexExists' | 'indexInformation' | 'indexes' | 'insertMany' | 'insertOne' | 'isCapped' | 'options' | 'rename' | 'replaceOne' | 'updateMany' | 'updateOne' | 'aggregate' | 'find' | 'listIndexes' | 'watch' > ;
96
+ declare const Db : new ( ) => Omit < MDBDb , 'command' | 'removeUser' | 'createCollection' | 'dropCollection' | 'createIndex' | 'dropDatabase' | 'indexInformation' | 'profilingLevel' | 'setProfilingLevel' | 'renameCollection' | 'stats' | 'collections' | 'collection' | 'admin' | 'aggregate' | 'listCollections' | 'watch' > ;
100
97
declare const GridFSBucket : new ( db : LegacyDb , options : GridFSBucketOptions ) => Omit < NonConstructor < MDBGridFSBucket > , 'delete' | 'rename' | 'drop' | 'find' > ;
101
98
declare const MongoClient : new ( url : string , options ?: MongoClientOptions ) => Omit < NonConstructor < MDBMongoClient > , 'connect' | 'close' | 'db' | 'watch' | 'withSession' | 'startSession' > ;
102
99
declare const ClientSession : new ( ) => Omit < MDBClientSession , 'endSession' | 'abortTransaction' | 'commitTransaction' | 'withTransaction' >
@@ -156,22 +153,6 @@ declare class LegacyAdmin extends Admin {
156
153
ping ( callback : Callback < Document > ) : void ;
157
154
ping ( options : CommandOperationOptions ) : Promise < Document > ;
158
155
ping ( options : CommandOperationOptions , callback : Callback < Document > ) : void ;
159
- /**
160
- * Add a user to the database
161
- *
162
- * @param username - The username for the new user
163
- * @param password - An optional password for the new user
164
- * @param options - Optional settings for the command
165
- * @param callback - An optional callback, a Promise will be returned if none is provided
166
- */
167
- addUser ( username : string ) : Promise < Document > ;
168
- addUser ( username : string , callback : Callback < Document > ) : void ;
169
- addUser ( username : string , password : string ) : Promise < Document > ;
170
- addUser ( username : string , password : string , callback : Callback < Document > ) : void ;
171
- addUser ( username : string , options : AddUserOptions ) : Promise < Document > ;
172
- addUser ( username : string , options : AddUserOptions , callback : Callback < Document > ) : void ;
173
- addUser ( username : string , password : string , options : AddUserOptions ) : Promise < Document > ;
174
- addUser ( username : string , password : string , options : AddUserOptions , callback : Callback < Document > ) : void ;
175
156
/**
176
157
* Remove a user from a database
177
158
*
@@ -637,16 +618,6 @@ declare class LegacyCollection<TSchema extends Document = Document> extends Coll
637
618
indexes ( callback : Callback < Document [ ] > ) : void ;
638
619
indexes ( options : IndexInformationOptions ) : Promise < Document [ ] > ;
639
620
indexes ( options : IndexInformationOptions , callback : Callback < Document [ ] > ) : void ;
640
- /**
641
- * Get all the collection statistics.
642
- *
643
- * @param options - Optional settings for the command
644
- * @param callback - An optional callback, a Promise will be returned if none is provided
645
- */
646
- stats ( ) : Promise < CollStats > ;
647
- stats ( callback : Callback < CollStats > ) : void ;
648
- stats ( options : CollStatsOptions ) : Promise < CollStats > ;
649
- stats ( options : CollStatsOptions , callback : Callback < CollStats > ) : void ;
650
621
/**
651
622
* Find a document and delete it in one atomic operation. Requires a write lock for the duration of the operation.
652
623
*
@@ -868,22 +839,6 @@ declare class LegacyDb extends Db {
868
839
createIndex ( name : string , indexSpec : IndexSpecification , callback ?: Callback < string > ) : void ;
869
840
createIndex ( name : string , indexSpec : IndexSpecification , options : CreateIndexesOptions ) : Promise < string > ;
870
841
createIndex ( name : string , indexSpec : IndexSpecification , options : CreateIndexesOptions , callback : Callback < string > ) : void ;
871
- /**
872
- * Add a user to the database
873
- *
874
- * @param username - The username for the new user
875
- * @param password - An optional password for the new user
876
- * @param options - Optional settings for the command
877
- * @param callback - An optional callback, a Promise will be returned if none is provided
878
- */
879
- addUser ( username : string ) : Promise < Document > ;
880
- addUser ( username : string , callback : Callback < Document > ) : void ;
881
- addUser ( username : string , password : string ) : Promise < Document > ;
882
- addUser ( username : string , password : string , callback : Callback < Document > ) : void ;
883
- addUser ( username : string , options : AddUserOptions ) : Promise < Document > ;
884
- addUser ( username : string , options : AddUserOptions , callback : Callback < Document > ) : void ;
885
- addUser ( username : string , password : string , options : AddUserOptions ) : Promise < Document > ;
886
- addUser ( username : string , password : string , options : AddUserOptions , callback : Callback < Document > ) : void ;
887
842
/**
888
843
* Remove a user from a database
889
844
*
0 commit comments