peek for Fermin

### This is not a PR
Just used to interchange info.
Will be removed after fulfilling its purpose
First of all, I think that this part about the JS funtion should be rollbacked. Taking into account that, the "structure" of the query currently is:

```
{
    "$or": [
        {
            "entities.id": "E1",
            "$or": [
                {
                    "entities.type": "T1"
                },
                {
                    "entities.type": {
                        "$exists": false
                    }
                }
            ],
            "entities.isPattern": "false",
            "conditions.type": "ONCHANGE",
            "conditions.value": "A1",
            "expiration": {
                "$gt": 1360232700
            }
        },
        {
            "entities.isPattern": "true",
            "conditions.type": "ONCHANGE",
            "conditions.value": "A1",
            "expiration": {
                "$gt": 1360232700
            },
            "$where": "function(){ ... }"
        }
    ]
}
```

Basically, the solution is to add a filter for servicePath in both "branches" (the one for pattern and the one for not-pattern) of the query, i.e.:

```
{
    "$or": [
        {
            "entities.id": "E1",
            "$or": [
                {
                    "entities.type": "T1"
                },
                {
                    "entities.type": {
                        "$exists": false
                    }
                }
            ],
            "entities.isPattern": "false",
            "conditions.type": "ONCHANGE",
            "conditions.value": "A1",
            "expiration": {
                "$gt": 1360232700
            },
            "servicePath": /<regex to detect servicePath>/
        },
        {
            "entities.isPattern": "true",
            "conditions.type": "ONCHANGE",
            "conditions.value": "A1",
            "expiration": {
                "$gt": 1360232700
            },
            "servicePath": /<regex to detect servicePath>/,
            "$where": "function(){ ... }"
        }
    ]
}
```
Now, let's think how `<regex to detec servicePath>` should be. I will do that in a separate comment, follwoing this one.