You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* const client = new MongoClient('mongodb://localhost:27017');
36
+
* const admin = client.db().admin();
37
+
* const dbInfo = await admin.listDatabases();
38
+
* for (const db of dbInfo.databases) {
39
+
* console.log(db.name);
40
+
* }
52
41
* ```
53
42
*/
54
43
exportclassAdmin{
@@ -71,8 +60,10 @@ export class Admin {
71
60
* @param callback - An optional callback, a Promise will be returned if none is provided
72
61
*/
73
62
command(command: Document): Promise<Document>;
63
+
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
* @param callback - An optional callback, a Promise will be returned if none is provided
97
88
*/
98
89
buildInfo(): Promise<Document>;
90
+
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
* @param callback - An optional callback, a Promise will be returned if none is provided
116
109
*/
117
110
serverInfo(): Promise<Document>;
111
+
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
* @param callback - An optional callback, a Promise will be returned if none is provided
135
130
*/
136
131
serverStatus(): Promise<Document>;
132
+
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
* @param callback - An optional callback, a Promise will be returned if none is provided
154
151
*/
155
152
ping(): Promise<Document>;
153
+
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
* @param callback - An optional callback, a Promise will be returned if none is provided
175
174
*/
176
175
addUser(username: string): Promise<Document>;
176
+
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
183
186
addUser(
184
187
username: string,
185
188
password: string,
@@ -221,8 +224,10 @@ export class Admin {
221
224
* @param callback - An optional callback, a Promise will be returned if none is provided
222
225
*/
223
226
removeUser(username: string): Promise<boolean>;
227
+
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
252
259
validateCollection(
253
260
collectionName: string,
254
261
options: ValidateCollectionOptions,
@@ -276,8 +283,10 @@ export class Admin {
276
283
* @param callback - An optional callback, a Promise will be returned if none is provided
277
284
*/
278
285
listDatabases(): Promise<ListDatabasesResult>;
286
+
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
* @param callback - An optional callback, a Promise will be returned if none is provided
301
310
*/
302
311
replSetGetStatus(): Promise<Document>;
312
+
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
Copy file name to clipboardExpand all lines: src/change_stream.ts
+4
Original file line number
Diff line number
Diff line change
@@ -645,6 +645,7 @@ export class ChangeStream<
645
645
646
646
/** Check if there is any document still available in the Change Stream */
647
647
hasNext(): Promise<boolean>;
648
+
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
/** Get the next available document from the Change Stream. */
677
678
next(): Promise<TChange>;
679
+
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
* Try to get the next available document from the Change Stream's cursor or `null` if an empty batch is returned
710
712
*/
711
713
tryNext(): Promise<Document|null>;
714
+
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
0 commit comments