Revert "Revert "SERVER-14728 Shard depends on string comparison of replica set connection string""

This reverts commit d261864e9156af7ecc3d0491111dffa0161e9d0d.

(cherry picked from commit 50601136fc8b9399a1832b84396e74e7bc9011c5)
SERVER-14728 Shard depends on string comparison of replica set connection string

Fix iterator incompatible issue.

(cherry picked from commit e97e4f04874a10a3d427a23eb3de4f97234b8c89)