sitewhere MongoDB持久化存储原理

2022-04-24 00:00:00 专区 订阅 付费 交易 评论

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);


来源 https://blog.csdn.net/orchidofocean/article/details/79835451?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522165076954316782388078446%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=165076954316782388078446&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~rank_v31_ecpm-25-79835451.nonecase&utm_term=SiteWhere&spm=1018.2226.3001.4450

相关文章