|
|
@@ -104,6 +104,11 @@ klass.compare = function compare(l, r) {
|
|
|
if (isNaN(r)) return 1;
|
|
|
return l < r ? -1 : l > r ? 1 : 0;
|
|
|
}
|
|
|
+ // Compare MinKey and MaxKey cases
|
|
|
+ if(l.constructor && l.constructor.name in ['MinKey','MaxKey'] ){
|
|
|
+ if(l.constructor.name == r.constructor.name) { return 0; }
|
|
|
+ return ['MinKey','$Jared','MaxKey'].indexOf(l.constructor.name) - 1;
|
|
|
+ }
|
|
|
// hack: These should really get converted to their BSON type ids and then compared, we use int vs object in queries
|
|
|
if (lt === "number" && rt === "object"){
|
|
|
return -1;
|