I'm not sure whether it can be just one call. `nodesToShards` and `replicaSets` hold different, both possibly valuable information; as it doesn't add too much memory overhead, should we keep both data structures?
Other than that, we can add a private helper method to add to both structures.