diff options
author | Eliot Horowitz <eliot@10gen.com> | 2009-10-20 16:15:27 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2009-10-20 16:15:27 -0400 |
commit | 8615f7d1cd2a4443b4ae6d2ce478d638021cfcab (patch) | |
tree | 2afcafa54d05a9412e286a8dd1f2fe1f5f2d4ade /shell | |
parent | 672f2821af24bc31d16b9ef9133b5b5ce177bf8f (diff) | |
download | mongo-8615f7d1cd2a4443b4ae6d2ce478d638021cfcab.tar.gz |
fix ensureIndex to return errors
Diffstat (limited to 'shell')
-rw-r--r-- | shell/collection.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/shell/collection.js b/shell/collection.js index d7c4c253ed9..83cc98f9716 100644 --- a/shell/collection.js +++ b/shell/collection.js @@ -259,9 +259,14 @@ DBCollection.prototype.ensureIndex = function( keys , options ){ } this.createIndex( keys , options ); + var e = this._db.getLastError(); + if ( e != null ) + throw e; + if ( this.getDB().getLastError() == "" ) { this._indexCache[name] = true; } + return true; } |