com.anwen.mongo.execute.Execute Maven / Gradle / Ivy
package com.anwen.mongo.execute;
import com.anwen.mongo.model.MutablePair;
import com.mongodb.BasicDBObject;
import com.mongodb.bulk.BulkWriteResult;
import com.mongodb.client.AggregateIterable;
import com.mongodb.client.FindIterable;
import com.mongodb.client.MongoCollection;
import com.mongodb.client.model.*;
import com.mongodb.client.result.DeleteResult;
import com.mongodb.client.result.InsertManyResult;
import com.mongodb.client.result.UpdateResult;
import org.bson.Document;
import org.bson.conversions.Bson;
import java.util.List;
/**
* 执行器接口
*
* @author JiaChaoYang
**/
public interface Execute {
InsertManyResult executeSave(List documentList, MongoCollection collection);
DeleteResult executeRemove(Bson filter, MongoCollection collection);
UpdateResult executeUpdate(List> bsonPairList,MongoCollection collection);
FindIterable executeQuery(Bson queryBasic, BasicDBObject projectionList, BasicDBObject sortCond, Class clazz, MongoCollection collection);
AggregateIterable executeAggregate(List extends Bson> aggregateConditionList, Class clazz, MongoCollection collection);
long executeCount(BasicDBObject queryBasic,CountOptions countOptions,MongoCollection collection);
long estimatedDocumentCount(MongoCollection collection);
BulkWriteResult executeBulkWrite(List> writeModelList, MongoCollection collection);
String doCreateIndex(Bson bson,MongoCollection collection);
String doCreateIndex(Bson bson,IndexOptions indexOptions,MongoCollection collection);
List doCreateIndexes(List indexes,MongoCollection collection);
List doCreateIndexes(List indexes, CreateIndexOptions createIndexOptions,MongoCollection collection);
List doListIndexes(MongoCollection collection);
void doDropIndex(String indexName,MongoCollection collection);
void doDropIndex(String indexName,DropIndexOptions dropIndexOptions,MongoCollection collection);
void doDropIndex(Bson keys,MongoCollection collection);
void doDropIndex(Bson keys,DropIndexOptions dropIndexOptions,MongoCollection collection);
void doDropIndexes(MongoCollection collection);
void doDropIndexes(DropIndexOptions dropIndexOptions,MongoCollection collection);
}