fastify.mongo.client.topology // TS2339: Property topology does not exist on type MongoClient
Bugs5382 opened this issue · comments
Shane commented
Prerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure the bug has not already been reported
Fastify version
4.26.1
Plugin version
8.0.0
Node.js version
20.11
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
14.4
Description
The decorator can see to "client," and then the topology is missing.
Even though TypeScript is reporting it as "not defined", which is odd, it should, the code runs without issue.
return fastify.mongo.client.topology.isConnected()
Steps to Reproduce
I am using this as part of a health check:
fastify.addHealthCheck('mongodb', async () => {
return fastify.mongo.client.topology.isConnected()
})
this
Expected Behavior
It should be valid and give proper documentation of other available options. I think this might be due to the package of the MongoDB client, which was raised a long time ago.
KaKa commented
I am closing this issue because mongodb
exclude the types from release.
Which means topology
is something internal and they don't want to expose.