com.github.aidensuen.mongo.executor.Executor Maven / Gradle / Ivy
package com.github.aidensuen.mongo.executor;
import com.github.aidensuen.mongo.core.MongoDaoStatement;
import com.mongodb.client.result.DeleteResult;
import com.mongodb.client.result.UpdateResult;
import org.bson.Document;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.core.aggregation.AggregationResults;
import java.util.Collection;
import java.util.List;
import java.util.function.Function;
public interface Executor {
Function DEFAULT_CONVERTER = Function.identity();
T save(MongoDaoStatement ms, T objectToSave);
T insert(MongoDaoStatement ms, T objectToSave);
Collection insert(MongoDaoStatement ms, Collection extends T> batchToSave);
DeleteResult remove(MongoDaoStatement ms, Object parameter);
List find(MongoDaoStatement ms, Object parameter, Pageable pageable, Function converter);
long count(MongoDaoStatement ms, Object parameter);
boolean exists(MongoDaoStatement ms, Object parameter);
UpdateResult update(MongoDaoStatement ms, Object parameter);
AggregationResults aggregate(MongoDaoStatement ms, Object parameter);
Document executeCommand(MongoDaoStatement ms, Object parameter);
}