> For the complete documentation index, see [llms.txt](https://timsixths-plugins.gitbook.io/minigameapi-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://timsixths-plugins.gitbook.io/minigameapi-docs/modules/internal-modules/mongodb-module/mongodbmodel.md).

# MongoDbModel

Every database model must implment MongoDbModel.

A class must have a field that is annotated by Id annotation

Define your table name in geTableName method.

{% hint style="danger" %}
The table name must be defined without a table prefix.
{% endhint %}

Example of the implementation of MongoDbModel.

```java

public class MyUser implements MongoDbModel, User {

    @Id
    private final UUID uuid;
    private double coins;
    
    public static final String COLLECTION_NAME = "users";

    public MyUser(UUID uuid, double coins) {
        this.uuid = uuid;
        this.coins = coins;
    }
    
    //getters and setters
    
    @Override
    public String getCollectionName() {
        return COLLECTION_NAME;
    }
    
    @Override //you can create your own DAO (optional)
    public Dao getDao() {
        return new MongoDbMyUserDao(this);
    }
}
```
