docs: function closeConnection() {
      expect(arguments).to.have.length(
        0,
        'Invalid arguments length when closing a connection in a MongoAdapter ' +
        '(it has to be passed no arguments)'
      );
  
      return new Promise(function (resolve, reject) {
        if (_databaseIsLocked) {
          _databaseRequestQueue.push(function () {
            closeConnection()
              .then(resolve)
              .catch(reject);
          });
        } else if (!_database) {
          resolve();
        } else {
          _databaseIsLocked = true;
          _database
            .close()
            .then(function () {
              _database = null;
              _databaseIsLocked = false;
              resolve();
              _processDatabaseRequestQueue();
            })
            .catch(function (error) {
              _databaseIsLocked = false;
              reject(error);
              _processDatabaseRequestQueue();
            });
        }
      });
    }