diff --git a/lib/sdam/topology_description.js b/lib/sdam/topology_description.js index 1f8ebcd24..8bd7473e0 100644 --- a/lib/sdam/topology_description.js +++ b/lib/sdam/topology_description.js @@ -226,6 +226,16 @@ class TopologyDescription { hasWritableServer() { return this.hasReadableServer(ReadPreference.primary); } + + /** + * Determines if the topology has a definition for the provided address + * + * @param {String} address + * @return {Boolean} Whether the topology knows about this server + */ + hasServer(address) { + return this.servers.has(address); + } } function topologyTypeForServerType(serverType) {