mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 00:56:44 +01:00
can't throw an exception...
This commit is contained in:
parent
8615f7d1cd
commit
4c856f6e8f
@ -255,19 +255,14 @@ DBCollection.prototype.ensureIndex = function( keys , options ){
|
||||
var name = this._indexSpec( keys, options ).name;
|
||||
this._indexCache = this._indexCache || {};
|
||||
if ( this._indexCache[ name ] ){
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
this.createIndex( keys , options );
|
||||
var e = this._db.getLastError();
|
||||
if ( e != null )
|
||||
throw e;
|
||||
|
||||
if ( this.getDB().getLastError() == "" ) {
|
||||
this._indexCache[name] = true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
DBCollection.prototype.resetIndexCache = function(){
|
||||
|
Loading…
Reference in New Issue
Block a user