summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-02-06 12:31:24 -0500
committerEliot Horowitz <eliot@10gen.com>2009-02-06 12:31:24 -0500
commitd2801728edf7ddc045075c3a5c3abcac3decab3a (patch)
treeb2f7451b0bbae6afeefd48937298d7c63d30a3e2 /shell
parentc9bc5b0baa195154c6d4e4eba9dbcf16e0bc4bab (diff)
downloadmongo-d2801728edf7ddc045075c3a5c3abcac3decab3a.tar.gz
it get mapped to last result
Diffstat (limited to 'shell')
-rw-r--r--shell/collection.js6
-rw-r--r--shell/utils.js1
2 files changed, 4 insertions, 3 deletions
diff --git a/shell/collection.js b/shell/collection.js
index 515950f178b..e81cc205b93 100644
--- a/shell/collection.js
+++ b/shell/collection.js
@@ -105,7 +105,7 @@ DBCollection.prototype.insert = function( obj ){
if ( ! obj )
throw "no object!";
this._validateForStorage( obj );
- this._mongo.insert( this._fullName , obj );
+ return this._mongo.insert( this._fullName , obj );
}
DBCollection.prototype.remove = function( t ){
@@ -120,10 +120,10 @@ DBCollection.prototype.update = function( query , obj , upsert ){
DBCollection.prototype.save = function( obj ){
if ( ! obj._id ){
- this.insert( obj );
+ return this.insert( obj );
}
else {
- this.update( { _id : obj._id } , obj , true );
+ return this.update( { _id : obj._id } , obj , true );
}
}
diff --git a/shell/utils.js b/shell/utils.js
index 4a1175573ef..8f8b1f9c2bd 100644
--- a/shell/utils.js
+++ b/shell/utils.js
@@ -138,6 +138,7 @@ tojsonObject = function( x ){
}
shellPrint = function( x ){
+ it = x;
if ( x != undefined )
shellPrintHelper( x );