Closed fabiooshiro closed 3 years ago
You think I broke it in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/43279 ?
@fabiooshiro which version of driver api you're using?
Hi, the version is "@types/mongodb": "^3.5.3",
On Fri, Mar 27, 2020 at 6:11 PM Piotr Błażejewicz (Peter Blazejewicz) < notifications@github.com> wrote:
@fabiooshiro https://github.com/fabiooshiro which version of driver api you're using?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DefinitelyTyped/DefinitelyTyped/issues/43391#issuecomment-605316825, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABVNEHMZKP5NPE3IVWVAG3RJUI7DANCNFSM4LUDE56A .
I'm seeing the same with client.isConnected()
Property 'isConnected' does not exist on type 'Mongo'.
I'll try to be on the same page, I believe MongoClient.isConnected({}?)
method works OK, with current types and driver 3.6,
const client = new MongoClient('mongodb://localhost:27017', {
useUnifiedTopology: true,
});
(async () => {
await client.connect()
if (client.isConnected()) {
await client.close();
}
})();
The server fires events, including 'connected', has no direct API on the surface to check connection status IMO: http://mongodb.github.io/node-mongodb-native/3.6/api/Server.html#event:connect (I could be wrong on this, never had to write a code to check the server status that way, client is enough)
Hi thread, we're moving DefinitelyTyped to use GitHub Discussions for conversations the @types
modules in DefinitelyTyped.
To help with the transition, we're closing all issues which haven't had activity in the last 6 months, which includes this issue. If you think closing this issue is a mistake, please pop into the TypeScript Community Discord and mention the issue in the definitely-typed
channel.
Hi @rifler
@types/mongodb
package and had problems.