Skip to content

Commit

Permalink
Merge pull request OptimalBits#106 from devinea/master
Browse files Browse the repository at this point in the history
Update mongodb-backend.js to create db index
  • Loading branch information
manast committed Aug 5, 2015
2 parents fc90da2 + 81be6fc commit 22f19bc
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 22f19bc

Please sign in to comment.