package com.flowci.core.flow.dao;

import com.flowci.core.flow.domain.Yml;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;

import java.util.List;

import static com.flowci.core.common.domain.Mongoable.SortByCreatedAtASC;

public class YmlCustomDaoImpl implements YmlCustomDao {

    @Autowired
    private MongoOperations operations;

    @Override
    public List<Yml> findAllWithoutRawByFlowId(String flowId) {
        Query query = Query.query(new Criteria()).with(SortByCreatedAtASC);
        query.fields()
                .include("id")
                .include("name")
                .include("flowId")
                .include("conditionInB64")
                .include("createdBy")
                .include("createdAt")
                .include("updatedAt")
                .include("updatedBy");

        return operations.find(query, Yml.class);
    }
}

@@ -641,20 +641,16 @@
 ery(
-new 
 Criteria
 ()).
@@ -645,17 +645,42 @@
 Criteria
-(
+.where(%22flowId%22).is(flowId
 )).with(

fix load all flow yaml list by flow id