Don't care about buildIndexes property on replica sets.
Try to use replSetGetConfig instead of querying system collection.