Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Commit

Permalink
feat(topology-description): add helper method for server ownership
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroadst committed May 23, 2018
1 parent 989e8cf commit 2c64c75
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/sdam/topology_description.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 2c64c75

Please sign in to comment.