summaryrefslogtreecommitdiff
path: root/shell/utils.js
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-08-11 04:54:58 -0400
committerEliot Horowitz <eliot@10gen.com>2009-08-11 04:54:58 -0400
commit5025bb763778ced9c993f55e94a6c6de67ae1058 (patch)
treec9bd72a50e3423c69c4ac29ab16a0fc19d939b11 /shell/utils.js
parent671cf3ddd45bca6ac7ee5e60dc835cc7e51e0b0e (diff)
downloadmongo-5025bb763778ced9c993f55e94a6c6de67ae1058.tar.gz
beter output for (Min|Max)Key
Diffstat (limited to 'shell/utils.js')
-rw-r--r--shell/utils.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/shell/utils.js b/shell/utils.js
index 94e375cd419..a14030e3240 100644
--- a/shell/utils.js
+++ b/shell/utils.js
@@ -256,6 +256,11 @@ tojsonObject = function( x ){
if ( typeof( x.tojson ) == "function" && x.tojson != tojson )
return x.tojson();
+ if ( x.toString() == "[object MaxKey]" )
+ return "{ $maxKey : 1 }";
+ if ( x.toString() == "[object MinKey]" )
+ return "{ $minKey : 1 }";
+
var s = "{";
var first = true;
@@ -466,3 +471,4 @@ Math.sigFig = function( x , N ){
var p = Math.pow( 10, N - Math.ceil( Math.log( Math.abs(x) ) / Math.log( 10 )) );
return Math.round(x*p)/p;
}
+