christkv/node-mongodb-native — pull request #491 by squamos (2012-02-02 02:00:09+00:00)
Title: Handle undefined document.me in mongo connection reply

replicaSetChanged is always being set in checkStateOfReplicasetFunction (line 377) because self._state.addresses does not match the number of members in the server's replSetGetStatus reply. the root of the issue seems to be that the connection reply from mongo doesn't have a 'me' attribute. thus, when the instanceServer is assigned to the _state.addresses object we erroneously use 'undefined' as the key:

replSetSelf._state.addresses[me] = instanceServer; (line 580)