Skip to content

Commit

Permalink
Update mongodb-backend.js
Browse files Browse the repository at this point in the history
Add index create to speed up performance where large numbers of resources are registered in ACL and called frequently
  • Loading branch information
devinea committed Mar 18, 2015
1 parent a155664 commit 81be6fc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/mongodb-backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ MongoDBBackend.prototype = {
if(err instanceof Error) return cb(err);
cb(undefined);
});
// Create index
collection.ensureIndex({_bucketname: 1, key: 1}, function(err){
if(err instanceof Error) { return cb(err);
}else{ cb(undefined);
}
});
});
});
},
Expand Down

0 comments on commit 81be6fc

Please sign in to comment.