This repository has been archived by the owner. It is now read-only.
MongoDB adapter for the express-brute middleware.
Switch branches/tags
Nothing to show
Clone or download
jfromaniello Merge pull request #15 from dirceu/update-mongo
Update mongodb lib to support MongoDB 3.2
Latest commit c16b17a Dec 1, 2016
Failed to load latest commit information.
test do not return the if the value is expired Dec 23, 2013
.gitignore initial Dec 21, 2013
LICENSE.txt Update LICENSE.txt Jan 14, 2016 Update Jan 26, 2015
index.js update deps Oct 19, 2016
package.json Update mongodb lib to support MongoDB 3.2 Nov 22, 2016

MongoDB store adapter for the express-brute.


npm install express-brute-mongo


var ExpressBrute = require('express-brute'),
var MongoStore = require('express-brute-mongo');
var MongoClient = require('mongodb').MongoClient;

var store = new MongoStore(function (ready) {
  MongoClient.connect('mongodb://', function(err, db) {
    if (err) throw err;

var bruteforce = new ExpressBrute(store);'/auth',
  bruteforce.prevent, // error 403 if we hit this route too often
  function (req, res, next) {

Expire documents

Create an index with expireAfterSeconds: 0 in mongo as follows:

db.my_api_limits_coll.ensureIndex({expires: 1}, {expireAfterSeconds: 0});

Issue Reporting

If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.




This project is licensed under the MIT license. See the LICENSE file for more info.