0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

fix ensureIndex to return errors

This commit is contained in:
Eliot Horowitz 2009-10-20 16:15:27 -04:00
parent 672f2821af
commit 8615f7d1cd

View File

@ -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;
}