<commit_before><h1>Configuration</h1>

ToroDB Stampede can be launch with custom configuration options. There are two ways to do it, using command modifiers or using a configuration file. The recommended way is using a configuration file because it is more versatile and self-documented.

To use the configuration file, the `-c` modifier should be specified.

```

```

The previous sections talk about basic configuration of the system, but it is highly probable that some specific configuration must be done to work in production environments.

## Custom relational database connection

Among the proper configuration into the relational database, ToroDB Stampede requires the URL to the server.

## Custom MongoDB connection<commit_msg>Added excludes on configuration<commit_after><h1>Configuration</h1>

ToroDB Stampede can be launch with custom configuration options. There are two ways to do it, using command modifiers or using a configuration file. The recommended way is using a configuration file because it is more versatile and self-documented.

To use the configuration file, the `-c` modifier should be specified.

```

```

The previous sections talk about basic configuration of the system, but it is highly probable that some specific configuration must be done to work in production environments.

## Custom relational database connection

Among the proper configuration into the relational database, ToroDB Stampede requires the URL to the server.

## Custom MongoDB connection

TODO

## Exclude a MongoDB database or collection

By default ToroDB Stampede replicates all databases and collections available in your MongoDB. You can exclude a whole database or some collection changing ToroDB Stampede configuracion.

In the replication section of the yml config file add an exclude item with the database to exclude:   

```json
replication:
  replSetName: rs1
  syncSource: localhost:27017
  exclude: 
    <database name>: "*"
```

or if you want to exclude just some collections:

```json
replication:
  replSetName: rs1
  syncSource: localhost:27017
  exclude: 
    <database name>:
    	<collection name>: "*"
```

For example, if you have two databases, films and music, and each one has two collections, title and performer. The configuration to exclude the whole music database, but in film database only performer collection, you should write:  

```json
replication:
  replSetName: rs1
  syncSource: localhost:27017
  exclude: 
    music: "*"
    film: 
        performer: "*"
```

In this case the only collection replicated is title from film database.


## Exclude a MongoDB index

Some index created in MongoDB for OLTP operations can be unusefull for OLAP and analytics operations. MongoDB indexes can be excluded in ToroDB Stampede allowing you to save disk space. You just need to add the index name  in the exclude section.

```json
replication:
  replSetName: rs1
  syncSource: localhost:27017
  exclude: 
    <database name>:
    	<collection name>:
    		- name: <index name>
```

If you want to exclude the index called city on collection performer from film database, you should write: 

```json
replication:
  replSetName: rs1
  syncSource: localhost:27017
  exclude: 
    film: 
        performer:
        	- name: city
```
 
{'fraction_non_alphanumeric': 0.05475680636280208, 'fraction_numerical': 0.010400734169470786, 'mean_word_length': 4.248796147672552, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6538273', 'n_tokens_mistral': 885, 'n_tokens_neox': 813, 'n_words': 432}