MongoDbDao

MongoDbDao methods:

MongoCollection<Document> getCollection(); //gets collection
Object getId() //gets correct value of Id field
MongoDbModel getModel() //gets model

How to create DAO?

public class MongoDbMyUserDao extends MongoDbDao {

    public MongoDbMyUserDao(Model model) {
        super(model);
    }

    @Override
    public Object update(Model model) {
        //define your update logic
        return model;
    }
    
    @Override
    public Object save(Model model) {
        //define your save logic
        return model;
    }

    @Override
    public boolean delete(Model model) {
        //define your delete logic

        return true;
    }

Last updated