mongodb-core
Advanced tools
Comparing version 2.1.19 to 2.1.20
@@ -762,4 +762,4 @@ "use strict" | ||
// Add primary to list if not a secondary read preference | ||
if(self.primary | ||
&& readPreference.preference != 'secondary' | ||
if(self.primary | ||
&& readPreference.preference != 'secondary' | ||
&& readPreference.preference != 'secondaryPreferred') { | ||
@@ -775,4 +775,4 @@ servers.push(self.primary); | ||
// If we have a secondaryPreferred readPreference and no server add the primary | ||
if(self.primary | ||
&& servers.length == 0 | ||
if(self.primary | ||
&& servers.length == 0 | ||
&& readPreference.preference != 'secondaryPreferred') { | ||
@@ -796,4 +796,3 @@ servers.push(self.primary); | ||
servers.sort(function(a, b) { | ||
// return a.time > b.time; | ||
return a.lastIsMasterMS > b.lastIsMasterMS | ||
return a.lastIsMasterMS - b.lastIsMasterMS | ||
}); | ||
@@ -822,3 +821,3 @@ | ||
// Add primary to list if not a secondary read preference | ||
if(self.primary | ||
if(self.primary | ||
&& readPreference.preference != 'secondary' | ||
@@ -835,3 +834,3 @@ && readPreference.preference != 'secondaryPreferred') { | ||
// If we have a secondaryPreferred readPreference and no server add the primary | ||
if(servers.length == 0 | ||
if(servers.length == 0 | ||
&& self.primary | ||
@@ -847,4 +846,3 @@ && readPreference.preference != 'secondaryPreferred') { | ||
servers.sort(function(a, b) { | ||
// return a.time > b.time; | ||
return a.lastIsMasterMS > b.lastIsMasterMS | ||
return a.lastIsMasterMS - b.lastIsMasterMS | ||
}); | ||
@@ -851,0 +849,0 @@ |
{ | ||
"name": "mongodb-core", | ||
"version": "2.1.19", | ||
"version": "2.1.20", | ||
"description": "Core MongoDB driver functionality, no bells and whistles and meant for integration not end applications", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
563625
156589
10586