class AbstractMongoDao extends AbstractDao<M,P,K,I> {

    protected Document toUpdateDocument(Update<P> update, Instant updateAt, I updateBy) {
        Document doc = new Document();

        Document setFields = partialMapper.toDocument(update.getPartial());
        Document set = new Document();
        for (String field : update.getSetFields()) {
            set.put(field, setFields.get(field));
        }

        FieldData fieldData = getFieldData();
        if (updateAt != null && fieldData.getUpdatedAt() != null) {
            set.put(fieldData.getUpdatedAt().getStorageName(), Date.from(updateAt));
        }
        if (updateBy != null && fieldData.getUpdatedBy() != null) {
            set.put(fieldData.getUpdatedBy().getStorageName(), updateBy);
        }

        Document unset = new Document();
        for (String field : update.getRemoveFields()) {
            unset.put(field, 1);
        }

        if (!set.isEmpty()) {
            doc.put("$set", set);
        }

        if (!unset.isEmpty()) {
            doc.put("$unset", unset);
        }

        return doc;
    }

    public  AbstractMongoDao(Class<M> modelClass, Class<P> partialClass, MongoCollection<Document> collection);
    public  AbstractMongoDao(Class<M> modelClass, Class<P> partialClass, MongoCollection<Document> collection, ObjectMapper objectMapper, ObjectMapper extendedJsonMapper);
    public  AbstractMongoDao(Class<M> modelClass, Class<P> partialClass, MongoCollection<Document> collection,
                            DocumentMapper<M> modelMapper, DocumentMapper<P> partialMapper);

}