@ Deprecated public List < ServerDescription > getPrimaries ( ) { return getServersByPredicate ( new Predicate ( ) { public boolean apply ( final ServerDescription serverDescription ) { return serverDescription . isPrimary ( ) ; } } ) ; }
While it may seem counter - intuitive that a MongoDB cluster can have more than one primary it can in the case where the client s view of the cluster is a set of mongos servers any of which can serve as the primary .