Skip to content

Commit

Permalink
reIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
erh committed Feb 9, 2009
1 parent 147948c commit c245e70
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion shell/collection.js
Expand Up @@ -162,7 +162,15 @@ DBCollection.prototype.resetIndexCache = function(){
this._indexCache = {};
}

DBCollection.prototype.dropIndexes = function() {
DBCollection.prototype.reIndex = function(){
var keys = this.getIndexKeys();
this.dropIndexes();
for ( var i in keys ){
this.ensureIndex( keys[i] );
}
}

DBCollection.prototype.dropIndexes = function(){
this.resetIndexCache();

var res = this._db.runCommand( { deleteIndexes: this.getName(), index: "*" } );
Expand Down

0 comments on commit c245e70

Please sign in to comment.