MongoDB数据持久化存储的通用处理程序
//Common handler for creating new objects. Assures that errors are handled in a consistent way.
public static void insert(MongoCollection<Document> collection, Document object, ErrorCode ifDuplicate);
//Common handler for updating existing objects. Assures that errors are handled in a consistent way.
public static void update(MongoCollection<Document> collection, Document query, Document object);
// Common handler for deleting objects. Assures that errors are handled in a consistent way.
public static DeleteResult delete(MongoCollection<Document> collection, Document object) ;
//Get a single entity by unique id.
public static <T> T get(String id, Class<T> api, MongoCollection<Document> collection, IMongoConverterLookup lookup);
//Search the given collection using the provided query and sort. Return the paged seaerch results.
public static <T> SearchResults<T> search(Class<T> api, MongoCollection<Document> collection, Document query,Document sort, ISearchCriteria criteria, IMongoConverterLookup lookup);
//Search the given collection using the provided query and sort.
public static <T> SearchResults<T> search(Class<T> api, MongoCollection<Document> collection, Document query, Document sort, IMongoConverterLookup lookup);
// List all items in the collection that match the qiven query.
public static <T> List<T> list(Class<T> api, MongoCollection<Document> collection, Document query, Document sort,IMongoConverterLookup lookup);
//Appends filter criteria onto exiting query based on the given date range.
public static void addDateSearchCriteria(Document query, String dateField, IDateRangeSearchCriteria criteria);
//Common handler for MongoDB client exceptions.
public static SiteWhereException handleClientException(MongoClientException e);