Question: I have a String like this:

```
Test+${user}100,very important text

```

I am trying to remove the part `+${user}100`

Why my code isn't working?

```
noSpecialSigns = noSpecialSigns.replaceAll("\\+$\\{user}\\d","");

```

Answer: 
```
@Document(collation="company")

```

This looks like a typo and the cause of your issue. You try to set collection name, but instead of [`collection`](https://docs.spring.io/spring-data/mongodb/docs/current/api/org/springframework/data/mongodb/core/mapping/Document.html#collection--) you use [`collation`](https://docs.spring.io/spring-data/mongodb/docs/current/api/org/springframework/data/mongodb/core/mapping/Document.html#collation--) property: <https://docs.mongodb.com/manual/reference/collation/>

The correct form of annotation would be:

```
@Document(collection = "company")
public class Company {
    // ...
}

```

Or simpler – since `value` is an alias for `collection`:

```
@Document("company")
public class Company {
    // ...
}

```

You can even completely omit collection name. In that case Spring will use class name as collection name:

```
@Document // name of collection wil be "company", as per class name
public class Company {
    // ...
}

```

The last example is why this was working for you with e.g. count queries, even though you did not provide collection name explicitly.
This sometime happens when you miss annotated entity class with annotation @Document

* Wrong
@Document(collation = "department")
* Right
@Document(collection = "department")