code: function validateDatabaseName(databaseName) {
    if (typeof databaseName !== 'string')
      throw MongoError.create({ message: 'database name must be a string', driver: true });
    if (databaseName.length === 0)
      throw MongoError.create({ message: 'database name cannot be the empty string', driver: true });
    if (databaseName === '$external') return;
  
    const invalidChars = [' ', '.', '$', '/', '\\'];
    for (let i = 0; i < invalidChars.length; i++) {
      if (databaseName.indexOf(invalidChars[i]) !== -1)
        throw MongoError.create({
          message: "database names cannot contain the character '" + invalidChars[i] + "'",
          driver: true
        });
    }
  }
docs: Validate the database name