SERVER-103603: Support .d.ts typings for common "conn" and "db" workflows (#35071)
GitOrigin-RevId: cce8abff91406ea4ed5be849ea3e041b4ac0bc86
This commit is contained in:
committed by
MongoDB Bot
parent
fe4ae2cca3
commit
9661e67028
@@ -11,5 +11,8 @@
|
||||
"src/mongo/shell/*.js",
|
||||
"src/mongo/shell/*.d.ts",
|
||||
"src/third_party/fast_check/**/*"
|
||||
],
|
||||
"exclude": [
|
||||
"jstests/libs/override_methods/"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ function setupTest() {
|
||||
print("START auth1.js");
|
||||
baseName = "jstests_auth_auth1";
|
||||
|
||||
m = MongoRunner.runMongod({auth: "", bind_ip: "127.0.0.1", useHostname: false});
|
||||
let m = MongoRunner.runMongod({auth: "", bind_ip: "127.0.0.1", useHostname: false});
|
||||
return m;
|
||||
}
|
||||
|
||||
|
||||
4
src/mongo/shell/collection.d.ts
vendored
4
src/mongo/shell/collection.d.ts
vendored
@@ -12,8 +12,8 @@ declare class DBCollection {
|
||||
getName()
|
||||
help()
|
||||
getFullName()
|
||||
getMongo()
|
||||
getDB()
|
||||
getMongo(): Mongo
|
||||
getDB(): DB
|
||||
find(filter, projection, limit, skip, batchSize, options)
|
||||
insert(obj, options)
|
||||
remove(t, justOne)
|
||||
|
||||
6
src/mongo/shell/db.d.ts
vendored
6
src/mongo/shell/db.d.ts
vendored
@@ -17,11 +17,9 @@ declare class DB {
|
||||
[collectionIndex: string]: DBCollection
|
||||
|
||||
rotateCertificates(message)
|
||||
getMongo()
|
||||
getSiblingDB(name)
|
||||
getName()
|
||||
getSiblingDB(name): DB
|
||||
stats(opt)
|
||||
getCollection(name)
|
||||
getCollection(name): DBCollection
|
||||
commandHelp(name)
|
||||
runReadCommand()
|
||||
runCommand(obj, extra, queryOptions)
|
||||
|
||||
6
src/mongo/shell/mongo.d.ts
vendored
6
src/mongo/shell/mongo.d.ts
vendored
@@ -2,11 +2,7 @@
|
||||
|
||||
declare class Mongo {
|
||||
constructor(uri?: string, encryptedDBClientCallback?, options?: object)
|
||||
|
||||
getDB(name): DB
|
||||
|
||||
startSession(opts?): DriverSession
|
||||
|
||||
find(ns, query, fields, limit, skip, batchSize, options)
|
||||
insert(ns, obj)
|
||||
remove(ns, pattern)
|
||||
@@ -15,7 +11,7 @@ declare class Mongo {
|
||||
getSlaveOk()
|
||||
setSecondaryOk(value = true)
|
||||
getSecondaryOk()
|
||||
getDB(name)
|
||||
getDB(name: string): DB
|
||||
getDBs(driverSession)
|
||||
adminCommand(cmd)
|
||||
runCommand(dbname, cmd, options)
|
||||
|
||||
4
src/mongo/shell/servers.d.ts
vendored
4
src/mongo/shell/servers.d.ts
vendored
@@ -1,8 +1,8 @@
|
||||
// type declarations for servers.js
|
||||
|
||||
declare module MongoRunner {
|
||||
export function runMongod(opts?: object): Mongo
|
||||
export function stopMongod(connection: Mongo): void
|
||||
function runMongod(opts?: object): Mongo
|
||||
function stopMongod(connection: Mongo): void
|
||||
}
|
||||
|
||||
declare function myPort()
|
||||
|
||||
2
src/mongo/shell/utils_sh.d.ts
vendored
2
src/mongo/shell/utils_sh.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// type declarations for utils_sh.js
|
||||
|
||||
declare var db
|
||||
declare var db: DB
|
||||
declare function printShardingStatus()
|
||||
|
||||
Reference in New Issue
Block a user