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:
parent
672f2821af
commit
8615f7d1cd
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user